Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

thread935-1271695 array of const records

Status
Not open for further replies.

Johnyq

Programmer
May 13, 2007
8
CA

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top