DelphiFAQ Home Search:
General :: Programming :: Delphi
General Delphi related information.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Recommended links on this topic:
Featured Article

How to declare and initialize static arrays

The following piece of Object Pascal shows how to declare and initialize static arrays:

const
    sArray1 : array [1..3] of string =
    (
       'item #1',
       'item #2',
       'item #3'
    );
 // For an array of records, it looks a little messy:
 const
    sArray2 : array [1..3] of record a : integer; b : string end =
    (
 	 (a: 100; b: 'Word 1'),
 	 (a: 200; b: 'Word 2'),
 	 (a: 300; b: 'Word 3')
    );
 

Generated 12:01:52 on Jan 18, 2018