Skip to content

Records

Different types under one name

  • AS topic 10.1 asks you to define a record: one identifier that holds several fields, and the fields can have different types.
  • A pet has a name (a STRING) and an age (an INTEGER). A record keeps both together under one name.
  • TYPE … ENDTYPE describes the record and declares each field.

TYPE Pet is an empty plan with fields Name and Age; DECLARE MyPet : Pet makes a real record whose .Name holds "Rex" and .Age holds 4

Handout

Log in or create account

IGCSE, A-Level & AP