6.0

Table Of Contents
159
StrToInt (function)
Converts a string into an integer value.
Syntax
strtoint( string ) integer value
Argument
string — String value to convert.
Code Sample Example
This example reads a column of 6 values then converts the values to integers and then adds the integer to
the &total variable. The total value is subsequently converted back to a string and the result is printed.
Example
define(&total,integer,0)
define(&x,integer,0)
for(&x,1,1,6)
set(&total,&total+strtoint(@(&x,10,18)))
endfor()
show(inttostr(&total))
Sub (function)
Subtracts one expression from another. This is the functional equivalent of the - operator.
Syntax
sub( expression, expression2 ) integer, measure, currency value
Arguments
expression1, expression2 — Integer, measure or currency values. Both expressions must be the same type.
The returned value is set according to the type of the parameters.
Code Sample Example
Example 1 and Example 2 illustrates both ways of subtracting numbers.
Example 1
show(inttostr(2-2))