pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
Example 38 Effect of fpoint on FIXED Simple Variables
FIXED(-3) f := 642987F; ! Stored as 642; accessed as 642000
FIXED(3) g := 0.642F; ! Stored as 642, accessed as 0.642
FIXED(2) h := 1.234F; ! Stored as 123; accessed as 1.23
Example 39 Initializing Simple Variables With Constants and Variables
INT global := 34; ! Only constants allowed
! in global initialization
PROC mymain MAIN;
BEGIN
INT local := global + 10; !Any expression allowed
INT local2 := global * local; ! in local or sublocal
FIXED local3 := $FIX(local2); ! initialization
!Lots of code
END; ! End of mymain procedure
Example 40 Declaring Simple VOLATILE Variables
VOLATILE INT i;
VOLATILE UNSIGNED(3) mask;
VOLATILE STRING gs;
Example 41 Procedure Addresses and Procedure Pointers
PROCADDR pa;
PROC32ADDR p32a;
PROC64ADDR p64a;
PROCPTR p (j); INT j; END PROCPTR;
PROC32PTR p32 (k); INT k; END PROCPTR;
INT PROC64PTR p64 (l, m); INT(32) l; INT(64) m; END PROCPTR;
STRUCT abc;
BEGIN
PROCPTR z (i); INT i; END PROCPTR;
END;
NOTE: The address and pointer types, EXT32ADDR, EXT64ADDR, PROC32ADDR, PROC64ADDR,
PROC32PTR, and PROC64PTR are available in the 64-bit addressing functionality added to the
EpTAL compiler starting with SPR T0561H01^AAP. For more information, see Appendix E, “64-bit
Addressing Functionality” (page 531).
Examples 107