Autor Beitrag
kat1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 40

Win XP
D6 EntPr
BeitragVerfasst: Fr 04.04.03 11:53 
Der Code

comp:=(x=0) and (not (odd(n));

(comp Boolean, x Real und n Integer)

liefert beim Compilieren folgende Fehlermeldung

"Operator not applicable to this operand type"

Hat jemand eine Erklärung dafür, ich finde nämlich keine und brauche diesen Ausdruck aber zur Exception Behandlung.
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Fr 04.04.03 12:29 
Hi
wenn du den Ausdruck exakt so geschrieben hast, dürfte er sich höchstens beschweren, dass noch ne schliessende Klammer fehlt. Probier's mal so:
ausblenden Quelltext
1:
comp:=((x=0) and (not (odd(n))));					


Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
kat1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 40

Win XP
D6 EntPr
BeitragVerfasst: Fr 04.04.03 13:45 
Danke für den Tipp. Habe inzwischen den Fehler mit der Klammer gefunden gehabt und es funktioniert auch, allerdings ist diese Fehlermeldung irreführend. :D
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 04.04.03 14:12 
Das Ding heißt ja auch Compiler und nicht Ich-weiß-was-der-Programmier-will-Entwicklungsumgebung. :wink: