Autor Beitrag
mexx2k
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 60



BeitragVerfasst: Mo 26.11.07 10:09 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
  case sInput of
    'green': iColor := 0;
    'red': iColor := 1;
    'brown': iColor := 2;
    'yellow':iColor := 3;
  end;


^^
ordinaltyp erforderlich??

Gruß
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: Mo 26.11.07 10:15 
case geht nur mit aufzählbaren Typen (Ordinaltypen: Integer, Word, Byte, Set u.ä.). Strings geht so gar nicht.
mexx2k Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 60



BeitragVerfasst: Mo 26.11.07 10:16 
ouh da merkt man, dass ich php verwöhnt bin ;)
alex517
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 60


D7Ent, FB, FIBPlus
BeitragVerfasst: Mo 26.11.07 10:27 
Hallo mexx2k,

mit einem kleinen Aufwand geht das auch in Delphi
siehe hier:

ID: 15797, Using case structure with strings

alex