Autor Beitrag
Tobias1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 454

Win 98, XP Prof
D3 Prof, D2005 Prof
BeitragVerfasst: Mi 03.11.04 13:12 
Warum kommt hier die Fehlermeldung 'Ordinaltyp erforderlich'
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var
x:string;
.
.
.
.
case x of
'D':Showmwssage('D');
end;

Kann man überhaupt einen string als case nehmen?

_________________
Auch das schlechteste Buch hat seine gute Seite: die letzte. (John Osborne)
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 03.11.04 13:16 
Case funktioniert nur mit Ordinal-Typen.
EDIT: Steht ja auch in der Fehlermeldung. :wink:
Strings sind demnach nicht zulässig.