Autor Beitrag
Bockscar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 105



BeitragVerfasst: Mi 22.02.06 12:21 
hey. ich habe folgende frage:

Ich möchte einen array haben z.b mit der laenge 14 (also ar : array [1..14] of integer) der von mir direkt den inhalt erhält.
dafür möchte ich nicht erst eine prozedur schreiben die z.b sagt ar[1] := 10, ar[2] := 17, ar[3] := 36.

Kann man nicht irgendwie das direkt festlegen ...

sowas wie: ar :array[1..14] of integer = [10,17,36,etc.]

vielen dank im voraus
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mi 22.02.06 12:26 
Du willst es also vorbelegen? Wenn es sich dabei um eine globale Variable handelt ist das sehr einfach möglich:

ausblenden Delphi-Quelltext
1:
MyArray: array[1..14] of integer=(1,2,3,4,5,6,7,8,9,10,11,12,13,14);