Autor Beitrag
Senex
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 17

WinXP
Delphi 7 Pers, Delphi2005 Pers, Turbo Delphi, Turbo C++
BeitragVerfasst: Sa 25.11.06 16:05 
Ich würde gerne eine Arraykonstante benutzen. Mein Problem ist jedoch, dass ich nicht weiß, wie ich die einzelnen Werte setzen kann.
Etwas wie:
ausblenden Delphi-Quelltext
1:
2:
const
  ConstArray: array of integer = (1,1,2,5,4,6,5);

funktioniert leider nicht.

_________________
Alles ist relativ. Außer der Lichtgeschwindigkeit. Die ist relativ konstant.
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Sa 25.11.06 16:35 
ungetestet:
ausblenden Delphi-Quelltext
1:
const arr: array [1..5] of integer = (1,2,3,4,5);					

du musst eben festlegen, den startwert 1 und den endwert 5!
Senex Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 17

WinXP
Delphi 7 Pers, Delphi2005 Pers, Turbo Delphi, Turbo C++
BeitragVerfasst: So 26.11.06 09:43 
Danke, so klappt's. Hab da wohl was mit C verwechselt... :oops:

_________________
Alles ist relativ. Außer der Lichtgeschwindigkeit. Die ist relativ konstant.