Entwickler-Ecke

Delphi Language (Object-Pascal) / CLX - konstantes array


ShadowThief - Do 27.11.03 16:54
Titel: konstantes array
kann man irgendwie ein konstantes array machen.
also ein array in der const -klausel?

danke.
shadow.


Anonymous - Do 27.11.03 16:59

ja, z.B. so:


Delphi-Quelltext
1:
2:
const
 x: array[0..3of byte = (1234);


records gehen auch, und zwar in der Art:


Delphi-Quelltext
1:
2:
3:
4:
5:
6:
 x: array[0..3of record
                    a,b: string;
                   end = ((a: 'a'; b: 'b'),
                          (a: 'c'; b: 'd'),
                          (a: 'e'; b: 'f'),
                          (a: 'g'; b: 'h'));


ShadowThief - Do 27.11.03 19:41

ok, alles klar, danke.

shadow.