7.4

Table Of Contents
Code Sample Example
In this example, the current position is set first and saved.
gsave and grestore are required to be issued in pairs, meaning that you need the equal number of gsave and grestore
commands to run in any given object. However, an uneven number of commands can be located in the code, if some of them
are within IFstatements, so that when the code is actually run, the pairing occurs correctly in all instances.
Example
moveto( 1, 1 )
%Position is now 1,1
gsave()
%Save current state
lineto( 2, 1 )
%Position is now 2,1
lineto( 2, 2 )
%Position is now 2,2
grestore()
%Restore previous state: position is now 1,1
GT (function)
Compares two expressions of any type and returns true if the first is greater than the second, false otherwise. This is the func-
tional equivalent to the > operator.
Syntax
gt( expression1, expression2 ) Boolean value
Arguments
expression1, expression2
Values of any type. Both expressions must be of the same type.
Code Sample Examples
Examples 1 and 2 illustrate both ways of comparing two expressions.
Example 1
if( gt(&current.line, 50) )
show('Bottom of page')
endif()
©2010 Objectif Lune Inc - 291 -