DEF VAR x AS INTEGER.
DEF VAR y AS INTEGER. DEF VAR z AS INTEGER. DEF VAR big AS INT64. /* NOTE: as far as the compiler is concerned, x + y is an INTEGER*/ /* NOTE: all failures are RUNTIME failures, not COMPILER failures*/ x = 2000000000. /*should succeed, just under 2gig*/ y = 2000000000. /*should succeed, just under 2gig*/ DISPLAY x + y FORMAT ">>>,>>>,>>>,>>>" . /*should succeed if format is big enough*/ z = x + y /* assignment >2gig to INTEGER should fail*/ INTEGER( x + /*INTEGER function on >2gig should fail*/ big = x + y. /*assignment >2gig to INT64 should succeed*/ DISPLAY x + y > 2000000000. /*compare >2gig with INTEGER constant should succeed*/ DISPLAY x + y > 3000000000. /*compare >2gig with INT64 constant should succeed */ PROCEDURE myproc: DEF INPUT PARAMETER mp AS INTEGER. DISPLAY mp. END. RUN myproc(big). /*INT64 with >2gig should fail*/ RUN myproc(x + y) /*INTEGER expression with >2gig should fail*/ big = 3. RUN myproc(big). /*INT64 with <2gig should succeed*/ big + x. /*is compiled as returning INT64*/ x + y. /*is compiled as returning INTEGER*/ y = NEXT-VALUE(next-cust-num). /*sequence is compiled with INT64 datatype if the sequence is up to >2gig, this will fail*/ big = NEXT-VALUE(next-cust-num). /*sequence is compiled with INT64 datatype if the sequence is up to >2gig, this will still succeed*/ |