The static array assignment method is as follows:
The code is as follows:
UnitUnit1;Interfaceuseswinapi.windows, Winapi.messages, System.sysutils, System.variants, system.classes, Vcl.graphics, Vcl.Controls, Vcl.forms, Vcl.dialogs, Vcl.stdctrls;typeTForm1=class(tform) Memo1:tmemo; Button1:tbutton; procedureButton1Click (Sender:tobject); Private {Private Declarations} Public {Public Declarations} End;varForm1:tform1;Implementation{$R *.DFM}usesSystem.Diagnostics, System.Math;typeTdaytemperatures=Array[1.. -] ofInteger;//function Definitionprocedureshowstaticarrays ();varM_daytemperatures:tdaytemperatures; I:integer;begin forI: = Low (M_daytemperatures) toHigh (M_daytemperatures) Do beginM_daytemperatures[i]:=I; End; forI: = Low (M_daytemperatures) toHigh (M_daytemperatures) Do beginForm1.Memo1.Lines.Add ('m_daytemperatures['+ i.tostring +'] := '+M_daytemperatures[i]. ToString); End;End;//Defining function ConfigurationstypeTintproc=procedure(Num:integer);//TimingprocedureTform1.button1click (sender:tobject);beginshowstaticarrays ();End;End.
Handbook 013: Static array