12.3 Variables, functions, arithmetic expressions and file reading
The UDO language is simple. Here are some general rules:
· Declaration of the variables is automatic and is done by:
¨ Declaration as one of the UDO parameters. In a such case it is assumed to be numerical or text depending on the declared initial value.
¨ Appearing on the left side of an equation. In a such case it is assumed to be numerical or text depending on the value of the right side of the equation.
· Strings not declared as variable names and not recognised as key words of UDO language are treated as text.
· Function VAR (text); returns the value of the variable of the name equal to text.
· All variables are global within one UDO. The values of variables can be transmitted to another UDO only through UDO parameters.
· Three variables denoting the coordinates of the object origin (x, y, z) are predefined and can be set/modified in a dialogue box.
· Arithmetic expressions and standard functions are similar to those used in C-language.
· It is possible to read numerical variables from a file. To do that we need first to open such a file using the instruction OPENF(<file name>). Then READF will be returning the consecutive number read from the file. READF can be placed at the right side of the equation (e.g. a=READF;) as well as inside an equation (e.g. a=2*sin(READF)+b);. Opening of a new file automatically closes the file previously opened (if any).
Go to next Numbers and variables chapter.
Back to Syntax of the User Defined Object (UDO) language chapter.