forlang.hlp (Table of Contents; Topic list)
$STORAGE
                                             Up Contents Index Back
─────$STORAGE───────────────────────────────────────────────────────────────
 
     Action
 
     $STORAGE allocates <n> bytes of memory for all variables declared as
     integer or logical variables
 
     Syntax  $STORAGE:n
 
     Remarks
 
     <n> must be either 2 or 4. The default is 4.
 
     The code required to perform 16-bit arithmetic is faster and more
     compact than the code required to perform 32-bit arithmetic.
     Setting $STORAGE to 2 allows programs to run faster and to be
     smaller but does not allow 32-bit arithmetic.
 
     $STORAGE does not affect the memory allocation of variables
     declared with an explicit length.
 
     If several files of a source program are compiled and linked
     together, be careful that they are consistent in their allocation
     of memory for variables.
 
     $STORAGE must precede the first declaration statement.
 
     The $STORAGE metacommand is equivalent to the /4I{2 | 4} compiler
     option.
 
     Example
 
     $STORAGE:2
 
     C     b and c are declared without a byte length, so they default
     C     to the $STORAGE value of 2 bytes. a and d will be 4 bytes.
 
           INTEGER*4 a, d
           INTEGER   b, c
 
           a = 65537
           b = 1024
 
     C     Since c is 2 bytes, it is assigned only the lower 2 bytes
     C     of a+b.
           c = a + b
           d = a + b
 
     C     The following statement produces:  1025        66561
           WRITE (*, *) c, d
           END
                                    -♦-