Skybuck Flying
2012-06-01 11:23:21 UTC
Hello,
The following example gives problems in Delphi XE2:
const
ErrorCode = ( 0, 1, 4, 5 );
ErrorString : array[ErrorCode] of string =
(
'Unknown', 'Success', 'Failure', 'Bad'
)
Delphi compiler will give an error message like:
[DCC Error] E2072 Number of elements (4)differs from declaration (6)
Needless to say this sux.
A solution could be something like:
ErrorString : array[ErrorCode] of string =
(
0 : ('Unknown'),
1 : ('Success'),
4 : ('Failure'),
5 : ('Bad')
)
This does not work, is there a solution ???
Bye,
Skybuck.
The following example gives problems in Delphi XE2:
const
ErrorCode = ( 0, 1, 4, 5 );
ErrorString : array[ErrorCode] of string =
(
'Unknown', 'Success', 'Failure', 'Bad'
)
Delphi compiler will give an error message like:
[DCC Error] E2072 Number of elements (4)differs from declaration (6)
Needless to say this sux.
A solution could be something like:
ErrorString : array[ErrorCode] of string =
(
0 : ('Unknown'),
1 : ('Success'),
4 : ('Failure'),
5 : ('Bad')
)
This does not work, is there a solution ???
Bye,
Skybuck.