__header__
Expression Local Tool
The Expression Local tool creates an expression, and evaluates a mathematical expression.
Using the Expression Local Tool
On the Expression Local tool's parameters page the user
defines
the expression that will be evaluated in the
"Expression" menu. When the tool is run the expression will
be
evaluated and the result will be displayed in the "Result" menu.
A, B, etc. can be defined within the tool itself, or can be
linked to
a global parameter by dragging the Parameter object off the ROT.
When the parameter object is added to a menu in the parameters
page (A, B, etc.) a dropdown menu will appear over the text box, and
the user can use the dropdown menu to select a parameter.
Example:
A = 25
B = 4
In the "Expression" menu type in "A*B".
When the tool is run the values in the A and B menus will be evaluated
and the result will be given in the "Result" menu.
Result = 100
Possible Expressions
The Maths tool incorporates all the basic math expressions (addition, subtraction, greater than, less than etc.) as well as several other more powerful expressions. Below is a list of the proper commands and their use.
String Functions
- Chr(str, index)
returns the ascii value of a character
- StrToNum
Can set the start, end and base of a string. ( str [,start] [,length] [,base])
Use - strtonum (str,0,10,5) to set the start position to 0 the number characters to 10 and the base to 5.
The square brackets [ ] denote an optional value.
- Find
Returns a value based on location.
Use - find (qwertyu, ty) and the value will return 5 because t is the 5th letter in the string.
- StrLen
- StrToNum
( str [, start] [, length] [, base])
Trig Functions
- Cos
Takes the Cosine
-
Sin
Takes the Sin
- Tan
Takes the Cosine
-
ArcSin
Takes the ArcSin
-
ArcCos
Takes the ArcCos
-
ArcTan
Takes the ArcTan
Maths Functions
-
Abs
Finds the absolute value.
Use - abs (-35) and the value will return 35.
-
Limit
Limit (val,Min,Max)
if the number exceed min max set to min max
-
CIR
CIR (val,Min,Max)
if the number exceed min max set to the circular entry between min max
eg CIR( angle, -179, 180)
-
Min
Finds the minimum value in a set of numbers.
Use - min (4, 1, 7, 4, 2) and the value will return 1.
-
Max
Finds the maximum value in a set of numbers.
Use - max (4, 1, 7, 4, 2) and the value will return 7.
-
Sqr
Finds the square of a value.
Use sqr (4) and the value will return 16.
-
Random(Min,Max)
-
Sqrt
Finds the square root of a value.
Use sqrt (4) and the value will return 2.
-
Cir(angle, lower, upper)
-
pi
-
ln(x)
return natural log
-
log
return log base 10
EULER
E
POW(x,y)
FLOOR(x)
If( Val, MinVal, MaxVal, newVal [,elseValue])
if(Val>=Min && Val <=Max)
Val = newVal
else
Val = elseVal if elseVal exsists
LOBYTE(x)
returns the lower 8 bits
HIBYTE(x)
returns the upper 8 bits of a 16 bit word
LOWORD(x)
returns the lower 16 bits
HIWORD(x)
returns the upper 16 bits of a 32 bit word