Autor Beitrag
Éde1987
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Fr 22.12.06 23:53 
Also ich hab hier was gemacht...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
var   x:char;
      a,b,c,d,e,f,g,h,i,j:integer;

begin
x:=Edit1.text[1];
Case x of

A: x:=1;
B: x:=2;
C: x:=3;
D: x:=4;
E: x:=5;
F: x:=6;
G: x:=7;
H: x:=8;
a: x:=1;
b: x:=2;
c: x:=3;
d: x:=4;
e: x:=5;
f: x:=6;
g: x:=7;
h: x:=8;
end;


er sagt aber es sei ein konstantenausdruck erwartet
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Fr 22.12.06 23:57 
Meinst du vielleicht das hier:
ausblenden Delphi-Quelltext
1:
2:
3:
'A': x := '1';
'B': x := '2';
...

Könnte man noch zusammenfassen.
Éde1987 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Sa 23.12.06 00:01 
Super danke^^
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Sa 23.12.06 00:03 
Zusammenfassen:
ausblenden Delphi-Quelltext
1:
2:
3:
  case x of
   'A'..'H','a'..'h': x := char(ord(Upcase(x))-ord('A')+ord('1'));
  end;