I want to create an array of records and have it be a typed constant, I've tried the following:
CODE
Type
ElementType = record
Noun : String ;
AtomNum : Byte ;
AtomMass : Real
end ;
Const
ATOM_TABLE : Array [0 .. 2] of ElementType =
(
('Hydrogen', 1, 1.00794),
('Helium', 2, 4.002602),
('Lithium', 3, 6.941)
The above example is nearly correct:
Insert type identifiers and semicolins like shown below.
Note parens around each record and around the entire group.
((noun: 'Hydrogen'; AtomNum: 1; AtomMass: 1.00794),
(more as necessary));
I had the same problem and finally found it in a HP-3000
computer pascal manual. These are available online and are
more complete than the Borland documentation.
Good Luck
JY