next up previous contents
Next: view Up: Commands Previous: ucut   Contents


valu

   'valu' <name> [[<value>|'push'|'pop'] [nr]] | ->
         [['&'|'*'|'/'|'+'|'-'|'abs'|'max'|'min'|'pow'|->
          'sqr'|'sin'|'cos'|'tan'|'asin'|'acos'|'atan'] ->
          'int'|'float'|'exp' ->
         [name name] ]
An entity which stores a string of characters. Most characters are valid but no white-spaces are accepted from the command line. The command parser will scan each parameter of each command for expressions which match the name of a value and will replace the parameter by the content of the value. For example

pnt P0 xvalue 0. 0.

uses the value 'xvalue'. If the user has previously defined the value with:

valu xvalue 1.24

then the command-parser will replace 'xvalue' by '1.24' in the 'pnt' command.

ATTENTION: The commands 'prnt', all commands starting with 'set' except 'seta' and 'setr' and 'valu' itself are not parsed for substitution. To suppress the substitution the value has to be masked by a leading '\'. For example the command:

del v \value

will delete the value itself. The content of a value can be defined by the user

valu arg1 1.24

or derived from the stack previously filled by a command

valu arg1 pop

if the ''stack'' was activated. A certain number on the stack can be addressed with

valu arg1 pop 2

were the '2' means that 2 successive 'pops' are executed. In this way the second value on the stack can be loaded at once.

Values can be written to the stack when the 'push' parameter is used:

valu arg1 push

A white-space separated string stored in a ``valu'' will be written to the stack in separate sub-strings. With this method single pieces of a white-space separated string can be splitted and stored in separate values:

stack on

opens the stack

valu complicatedString push

splits the string stored in 'complicatedString' and writes the single pieces to the stack. The command

valu subString pop 3

loads the 3rd substring into the varible 'subString'.

The command is able to perform simple calculations like

valu result * arg1 arg2

'result' will store the product from 'arg1' and 'arg2'. It is important to understand that the command deals only with other 'values'. That means that a direct multiplication of two numbers is not possible. The number has to be stored in a value before it can be used:

valu arg1 1.24

assigns the string ``1.24'' to the value 'arg1'. During the calulation the strings are converted to double precision numbers and the result is stored as a string representing an exponential number. The 'int', 'float' and 'exp' convert between integer, floating point and exponential format.

The '&' operator is used to concatenate two strings:

valu string3 & string1 string2

See also ``prnt'' and ''How to write values to a file''.


next up previous contents
Next: view Up: Commands Previous: ucut   Contents
root 2016-03-04