TAL Reference Manual
Compiler Directives
TAL Reference Manual—526371-001
16-70
Example of RESETTOG Directive
Example of RESETTOG Directive
In this example, RESETTOG turns off two of six toggles that were turned on by
SETTOG. IF tests a toggle, finds it is off, and causes the compiler to skip over the
source text between IF VERSN2 and ENDIF VERSN2 :
?SETTOG (versn1, versn2, 7, 4, 11) !Turn on toggles
?SETTOG versn3 !Turn on toggle
?RESETTOG (versn2, 7) !Turn off toggles
!Lots of code
?IF versn2 !Test toggle for on state
PROC version_2; !Find it off; skip
BEGIN ! procedure
!More code
END;
?ENDIF versn2 !End of skipped portion
ROUND Directive
ROUND rounds FIXED values assigned to FIXED variables that have smaller fpoint
values than the values you are assigning.
The default is NOROUND.
Usage Considerations
This directive can appear in the compilation command or anywhere in the source code.
ROUND turns the rounding setting on. If the fpoint of the assignment value is greater
than that of the variable, ROUND first truncates the assignment value so that its
fpoint
is one greater than that of the destination variable. The truncated assignment value is
then rounded away from zero as follows:
value = (IF value < 0 THEN value - 5 ELSE value + 5) / 10
In other words, if the truncated assignment value is negative, 5 is subtracted; if
positive, 5 is added. Then, an integer division by 10 and truncates it again, this time by
a factor of 10. Thus, if the absolute value of the least significant digit of the initially
VST1648.vsd
NOROUND
ROUND