6.0

Table Of Contents
115
Mid (function)
Extracts a specified number of characters from a string, starting at a specific position.
Syntax
mid( string, start, length ) string value
Arguments
string — String value from which to extract characters.
start — Integer value specifying where the first character to extract is located.
length — Integer value specifying how many characters to extract, starting from number onwards.
Code Sample Example
This example extracts a bracket-delimited word from a sentence.
Example
define(&data,string,'This is a [bracketed] word')
define(&i,integer, pos('[', &data))
%Find the '[' character
define(&j,integer, pos(']', &data))
%Find the ']' character
if((&i>0) and (&j>&i))
%If both were found
show(mid(&data,&i+1,(&j-&i)-1))
%Print the word
endif()
Mod (function & procedure)
Returns the remainder resulting from the division of two numbers.
Syntax
mod( number1, number2 ) integer value
number1 mod number2 integer value
Arguments
number1 — Integer value to be divided.