Autor Beitrag
Danf
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 27



BeitragVerfasst: Mi 03.03.10 19:26 
Servus,

Ich soll für die Schule (mal wieder) ein kleines Programm zu Ascii schreiben. An sich kein problem, allerdings schaffe ich es nicht eine Variable mit 2 zu erfüllenden Bedingungen zu definieren, hier mein(e) Ansätze:
X soll größer als 65 und kleiner als 90 sein damit die Bedingung erfüllt ist:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
VAR
   b : char;
   x : Integer;
begin
   b := edit1.text[1];
   x := ord(b);

      if 65 < x < 90 then
        begin
        x := x + 32;
        end;

   edit2.text := inttostr(x);
end;


Fehler: [Fehler] Unit1.pas(36): Inkompatible Typen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
VAR
   b : char;
   x : Integer;
begin
   b := edit1.text[1];
   x := ord(b);

      if x > 65 < 90 then
        begin
        x := x + 32;
        end;

   edit2.text := inttostr(x);
end;


Gleicher Fehler wie oben

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
VAR
   b : char;
   x : Integer;
begin
   b := edit1.text[1];
   x := ord(b);

      if x > 65 AND x < 90 then
        begin
        x := x + 32;
        end;

   edit2.text := inttostr(x);
end;


Und wieder der gleiche Fehler

Kann mir jemand sagen warum das nicht läuft, bzw. wo der fehler liegt?

Ich bedanke mich im vorraus
MFG
Danf
jfheins
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 918
Erhaltene Danke: 158

Win 10
VS 2013, VS2015
BeitragVerfasst: Mi 03.03.10 19:32 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
VAR
   b : char;
   x : Integer;
begin
   b := edit1.text[1];
   x := ord(b);

      if (x > 65AND (x < 90then
        begin
        x := x + 32;
        end;

   edit2.text := inttostr(x);
end;

Klammern ;)
Danf Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 27



BeitragVerfasst: Mi 03.03.10 19:50 
Danke für diene schnelle Antwort

Epic fail meinerseits

MFG
Danf