Autor Beitrag
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Do 02.09.04 00:01 
Ich will überprüfen ob die Zahl zwischen 0 und 30 liegt und ob es überhaupt eine Zahl ist.
ausblenden Delphi-Quelltext
1:
if  Cells[StringGrid1.Col,Row] <> [0..30]					

Delphi hat folgendes geschrieben:
Inkompatible Typen: 'String' und 'Set'

Wenn ich [0..30] durch z.b. '0' ersetze funktioniert es. :gruebel:
inselberg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458



BeitragVerfasst: Do 02.09.04 00:53 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
gueltig := true;
try
zahl:=strtoint(Cells[StringGrid1.Col,Row]);
except
 gueltig := false;
end;

gueltig:= ( ( zahl >=0 ) AND ( zahl <=30 ) AND gueltig );


Moderiert von user profile iconMotzi: Code- durch Delphi-Tags ersetzt.

_________________
hans bist du das ?
opfer.der.genauigkeit
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Do 02.09.04 01:05 
ausblenden Quelltext
1:
zahl:=strtoint(Cells[StringGrid1.Col,Row]);					


od.

ausblenden Quelltext
1:
2:
3:
 if not (StrToInt(Cells[StringGrid1.Col, Row]) in [0..30]) then begin

 end;

_________________
Stellen Sie sich bitte Zirkusmusik vor.
Coder Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Fr 15.10.04 19:18 
thx, hat funktioniert. :)