[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 VAR                         Variable Declaration                      pp 49


 Define:  VAR is the reserved word for variable declaration.

 Purpose: Declare both local and global variables.

 Notes:   Every variable must be declared prior to use or reference.
          Several standard type identifiers are provided, and the
          programmer may create his own type using the Type definition.


 ----------------------------------------------------------------------------


 Usage:
       TYPE
          PtrType   = ^Integer   ;  { Type is pointer to Integer data }
          SetType   = 0..7       ;  { Type is Set of 0 to 7 members   }
          DayType   = (Mon,Tue,Wed,Thu,Fri,Sat,Sun);
          StrType   = String [80];  { Type is 80 byte string          }


       VAR
          CharVar   : Char       ;
          ByteVar   : Byte       ;
          IntVar    : Integer    ;
          RealVar   : Real       ;
          StrVar1   : String [80];  { Type is 80 byte string          }
          StrVar2   : StrType    ;  { Type is user declared StrType   }
          PtrVar    : PtrType    ;  { Type is user declared PtrType   }
          DayVar    : DayType    ;  { Type is user declared DayType   }
          SetVar    : SetType    ;  { Type is user declared SetType   }

       BEGIN
       END.

See Also: Const Function Label Procedure Type
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson