Go to the first, previous, next, last section, table of contents.

Record Constructor

<rec type> "{" <expr1> "," ... "," <exprn> "}"

A record constructor is a record-valued expression. <rec type> must be a record type (see section Record Types). Each <expr> must evaluate to the type of the field in the record whose position it corresponds with. For greater clarity, each <expr> can be specified in an assignment expression (see example below). Every field must be provided with a value for the constructor to be valid.

TYPE
  Rec = RECORD x, y: INTEGER; s: TEXT; END;
VAR
  r1: Rec := Rec{5, 10, "Hello"};
  r2 := Rec{x := -5, y := 25, s := "Greetings"};


Go to the first, previous, next, last section, table of contents.