the basic idea...


[ Follow Ups ] [ Post Followup ] [ Awesome Software Online Message Board ] [ FAQ ]

Posted by Christopher B. Matthews 209.167.40.2 using Mozilla/4.0 (compatible; MSIE 5.5; Windows NT) on March 09, 2000 at 05:23:51:

In Reply to: Chris.... posted by Cole on March 07, 2000 at 17:55:08:

Here's how it's done....

Lets' say you have a line of text like this:
#a! = 2 + b!

Here's what the toolkit does...
Start searching at the front of the text for the command symbol (#)...

Once that's found, get all the text between the # and the = (in other words, it gets the text a!)

Now, continue to get the text after the =, but stop whenever you get to an operation symbol (+ - * /)

So, the next block of text it would get would be '2'

Then get the opteration symbol (+)

then get the next block of text b!

once we have '2' '+' and 'b!', we can do something...

First, evaluate each individual element... 2 is just 2, but what is b!?

In the toolkit, variables are stored in an array containing their values and a seperate array with their names. We serach thorough the name array and find 'b!'. Corresponding that to the value array, we get the value in b! (let's say it's 4)

So now we have our values: '2' '+' '4'

Since we know the operation ('+') we add the two numbers (6)

Now that we have evaluated the expression, we can assign this value to the original variable (a!)

So, we serach thru the name array until we find a!. If it doesn't exist, we add it.

Once we find out where a! is located, we toss the value '6' into the value array.

And that's it.




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ Awesome Software Online Message Board ] [ FAQ ]