[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
RECORD Data Structure with Fields pp 79
Syntax: Name = Record
Data: All Types
Type: Declaration
Purpose: Record creates a data structure made up of individual fields.
Notes: Each field is identified by a name unique to the record, and
is given a data type. The record fields are referenced
by the construct NAME.FIELD, where Name is the record name,
and Field is the field identifier.
The record must be terminated by END ;
Usage:
TYPE
Days = 1..31 ;
Months = (Jan,Feb,Mar,Apr,
May,Jun,Jul,Aug,
Sep,Oct,Nov,Dec) ;
Years = 1900..1999 ;
Date = Record
Day : Days ; { Day is 1..31 of Days }
Month : Months ; { Month is 1..12 of Months }
Year : Years ; { Year is 1900..1999 of Years }
End ; { End of record }
VAR
Birth : Date ;
BEGIN
Birth.Month := Nov ; { Month field }
Birth.Day := 4 ; { Day field }
Birth.Year := 1950 ; { Year field }
END.
See Also:
File
Variant
With
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson