|
-
Oct 10th, 2000, 12:53 AM
#1
Thread Starter
Addicted Member
I am working on a program that uses classes to draw components of PIPE and HVAC systems in Detail and arrangement forms. Current the program has some odd 120 classes, one for each componet that we have done in PIPE or HVAC i.e. a sleeve, valvue, tee, and so on. The program is getting to the point where it is hard to manage and update because of the number of classes. I have been assigned the job of finding a way to eliminate the mass number of classes and replace them with some type of outside file, like a DB or INI or even a txt file. It isn't possable to use a dll thats the first thing i tried .
So my question is does anyone know of a way to store equations outside of VB in a file and then run them inside of a VB program. The Idea is to gather all the need information then read the geometry equation from an outdide file that would be easy to update and manage via a second program....
Magiaus
Visual Basic 6.0 SP5
Visual C++ 6.0 SP5
The only sovereign you can allow to rule you is reason.
-
Oct 10th, 2000, 03:17 AM
#2
Hyperactive Member
Perhaps rephrase?
I have never heard of PIPE or HVAC which would normally
mean I wouldn't think to reply (I reckon loads of other
people are the same). But you finally ask a more generic
question which really has nothing to do with these special
acronyms right?
Are you looking for a way of storing mathematical equations
that you can use in a VB application in an external ?
If so, I might be able to help, but not right away. I
would imagine that many of the subscribers to the forum
have done this themselves and there may even be other
threads on the topic.
Look for words like serialise (or serialize/seialization
etc) of calculations.
Why I can't help straigh away is simply because I have a
Java version of this very thing that I had to do for a work
project and it would take a week or so before I got the
time to translate it into VB.
The Java class library I wrote will handle all BEDMAS
operations and also includes customiseable functions which
you can design as you need. The basic ones I implemented
mirrored many of the simple functions most programming
languages contain, such as INT, MOD, SIN, COS, TAN etc.
These objects could easily be wrapped up in a DLL which you
could then use in your applications.
The code I have in Java would calculate the correct result
for something like:
Code:
myvar = 1 - (3 * 2 / (3 + 4)) + 2 ^ (1 + 3)
Parsers often get stuck on handling successive brackets or
exponents or whatever. If you code this yourself, it is
easiest to think of the calculation as a tree in which
operation can cause a new branch to sprout or simply
continues along the same branch. Once the branches have
all been determined, each branch can return a result which
the "trunk" of the tree uses to figure out the final result.
Finally, if this is nothing to do with what you need then I
am very sorry that you've had to endure such a long reply 
Cheers
-
Oct 10th, 2000, 10:52 AM
#3
Thread Starter
Addicted Member
thanks
thats exactly what i want to do. I search for those strings as soon as I get to work.
Thanks
Magiaus
Visual Basic 6.0 SP5
Visual C++ 6.0 SP5
The only sovereign you can allow to rule you is reason.
-
Oct 10th, 2000, 02:00 PM
#4
Thread Starter
Addicted Member
?
Whats BEDMAS? PIPE is pipe that is routed through the interior of walls on a ship HVAC is the same thing only its Ventelation 
Thnaks
Magiaus
Visual Basic 6.0 SP5
Visual C++ 6.0 SP5
The only sovereign you can allow to rule you is reason.
-
Oct 10th, 2000, 02:18 PM
#5
Monday Morning Lunatic
I know BODMAS...not BEDMAS:
Brackets
Of
Division
Multiplication
Addition
Subtraction
It's the order that mathematical operations are applied.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 10th, 2000, 02:38 PM
#6
Hyperactive Member
Same thing...different country
We learn E for Exponents since "Of" is a little ambiguous. That is: if we said 2 of 3 we mean two thirds.
I guess it was considered too confusing for the students to learn that "of" referred to "to the power OF". So anyhow, we learn BEDMAS and then the E cannot get confused...
Cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|