pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

INT i;
INT(32) d;
STRING s;
END;
STRUCT .st;
BEGIN
INT i;
INT j;
INT .st_ptr(tt); ! Declare structure pointer
END; ! that points to structure tt
INT x;
x := $OFFSET (st.j); ! x gets 2
x := $OFFSET (tt.s); ! x gets 6
x := $OFFSET (st.st_ptr.s); ! x gets 6
Example 288 $OFFSET Routine Applied to a Template Structure
INT x;
STRUCT st[-1:1];
BEGIN
INT item;
FIXED(2) price;
END;
x := $OFFSET (st[-1].item); !x gets -10
$OPTIONAL
$OPTIONAL controls whether a given parameter or parameter pair is passed to a VARIABLE
procedure or EXTENSIBLE procedure.
NopTAL privileged procedure
NoCan be executed only by privileged procedures
NoSets condition code
NoSets $CARRY
NoSets $OVERFLOW
cond-expression
is a conditional expression. If cond-expression is true, param or param-pair is passed.
If cond-expression is false, param (or param-pair ) is not passed.
param
is an a variable identifier or an expression that defines an actual parameter to pass to a formal
parameter declared in the called procedure if cond-expression is true.
param-pair
is an actual parameter pair to pass to a formal parameter pair declared in the called procedure
if cond-expression is true. param-pair has the form:
Nonatomic Operations 333