FORTRAN 77 Language Reference

Example

Declare the structure /STUDENT/ to contain either NAME, CLASS, and MAJOR, or NAME, CLASS, CREDITS, and GRAD_DATE:


       STRUCTURE /STUDENT/ 
       CHARACTER*32  NAME 
       INTEGER*2  CLASS 
       UNION 
              MAP 
                     CHARACTER*16 MAJOR 
              END MAP 
              MAP 
                     INTEGER*2  CREDITS 
                     CHARACTER*8  GRAD_DATE 
              END MAP 
       END UNION 
       END STRUCTURE 
       RECORD /STUDENT/ PERSON 

In the above example, the variable PERSON has the structure /STUDENT/, so: