// 1. Standard Method: var myarr: array [0 .. 10] of integer; // defines a static Array
// 2. Non-0 Subscript: var myarr: array [9 .. 10] of integer can be used; // It cannot be promoted, so it is not easy to communicate with system functions.
// 3. declare An Array Based on the predefined type: Type tmyarr = array [0 .. 10] of integer; // first define an array type var myarr: tmyarr; // then define a static Array
// 4. In the non-process area, values can be directly assigned: var myarr: array [0 .. 2] of integer = (, 33 );
// 5. Multi-dimensional array: var myarr: array [0 .. 2, 0 .. 2] of integer; begin // use myarr [1, 2]: = 100; end;
// 6. Define an array according to the subinterface: Type trange = 0 .. 10; var myarr: array [trange] of integer;
// 7. defines an Array Based on enumeration: Type tenums = (enum1, enum2, enum3); var myarr: array [tenums] of string; begin myarr [enum1]: = 'case '; showmessage (myarr [enum1]); // In case of end;
// 8. array defined by other types: var myarr: array [byte] of char; begin myarr [255]: = #65; showmessage (myarr [255]); // aend; // try not to use the built-in type. You can create a new type: Type tnewbyte = byte; var myarr: array [tnewbyte] of char; begin myarr [255]: = #65; showmessage (myarr [255]); // aend; // You can also use the type alias: Type tchar = type char; var myarr: array [tchar] of byte; begin myarr ['C']: = 255; showmessage (inttostr (myarr ['C']); // 255end; // define the type simultaneously: Type myrec = record S: string; R: real; B: byte; end; var arr1: array [0 .. 100] of myrec; arr2: array [0 .. 100] of record S: string; R: real; B: byte; end; // you can define arr3: packed array [0 .. 100] of myrec; // compression array definition, as if there is no difference?