7.4

Table Of Contents
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()
Right (function)
Extracts the specified rightmost characters of a string.
Syntax
right( string, number ) string value
Arguments
string
String value from which to extract characters.
number
Integer value specifying how many characters to extract from the end of the string.
Code Sample Example
This example prints part of a string, starting after a specific delimiter.
Example
define(&data,string,'This is a~sample string')
define(&x,integer, pos('~', &data)) %Find tilde
if(&x>1)
show(right(&data,length(&data)-&x))
©2010 Objectif Lune Inc - 547 -