Autor Beitrag
Virchov
Hält's aus hier
Beiträge: 8

Win98
Delphi 7
BeitragVerfasst: Do 18.03.04 16:30 
Tach!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
function BinImgMatchProMile
(const BinImg1,BinImg2 :pboolean;  nElements: integer; BinImgPlus, BinImgMinus: pboolean): integer;

.....
if.... then.
.....
 else if (BinImg1 and   not (BinImg2)) then
.....


Warum geht das nicht? Operator ist auf diesen operandentyp nicht anwendbar - sagt der Compiler


Danke!


Moderiert von user profile icontommie-lie: Delphi-Tag korrigiert

_________________
Virchov
MaxiTB
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 679

Win2000, WinXp, Workbench ;-)
D7 Ent, VS2003 Arch.
BeitragVerfasst: Do 18.03.04 16:39 
Falsche, unlogische Klammerung:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
function BinImgMatchProMile
(const BinImg1,BinImg2 :pboolean;  nElements: integer; BinImgPlus, BinImgMinus: pboolean): integer;

.....
if.... then.
.....
 else if (BinImg1^ and  (not BinImg2^)) then
.....

_________________
Euer Mäxchen
Wer früher stirbt, ist länger tot.


Zuletzt bearbeitet von MaxiTB am Do 18.03.04 16:55, insgesamt 1-mal bearbeitet
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Do 18.03.04 16:42 
Titel: Re: Not- Operand geht in einer "else if" - Klause
Virchov hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
const BinImg1,BinImg2 :pboolean;
[...]
 else if (BinImg1 and   not (BinImg2)) then
.....
Warum geht das nicht? Operator ist auf diesen operandentyp nicht anwendbar - sagt der Compiler
Weil du Pointer übergibst (PBoolean ist kein Boolean-Wert sondern ein Pointer auf einen Boolean-Wert). Und da meckert der Compiler, weil er meint, daß du vermutlich die Boolean-Werte meintest, aber er sich nciht sicher sein kann (oder weil Delphi keine Integer als Boolean-Werte versteht, da bin ich mir jetzt nicht 100% sicher...).
Folgendes sollte aber klappen:
ausblenden Delphi-Quelltext
1:
2:
[...] if (BinImg1^) and not (BinImg2^) then
[...]



Virchov hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
.....
if.... then.
.....
Ich hoffe der Punkt ist nur ein Tippfehler :roll: Wenn man schon abtippt und nicht die richtige Funktion kopiert, sollte man dies wenigstens korrekt tun...

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Do 18.03.04 16:45 
MaxiTB hat folgendes geschrieben:
Falsche, unlogische Klammerung:
Wieso? Die Klammerung ist syntaktisch und logisch vollkommen in Ordnung, wenn auch überflüssig. Die Klammern in meiner Korrekter sind auch überflüssig, aber so fühl' ich mich wohler :mrgreen:

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Virchov Threadstarter
Hält's aus hier
Beiträge: 8

Win98
Delphi 7
BeitragVerfasst: Do 18.03.04 16:56 
Vielen Dank!

Der Punkt ist überflüssig, sorry!

_________________
Virchov
MaxiTB
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 679

Win2000, WinXp, Workbench ;-)
D7 Ent, VS2003 Arch.
BeitragVerfasst: Do 18.03.04 16:58 
:tommie-lie

Syntaktisch vielleicht, logisch habe ich eher als optisch gemeint:

(BinImg2)

Das ist nun mal nicht wirklich sehr optisch ansprechbar *g*.

PS: Bei dem schnellen copy&paste habe ich den Wertoperator vergessen - der hat natürlich auch gefehlt . :oops:

_________________
Euer Mäxchen
Wer früher stirbt, ist länger tot.
Virchov Threadstarter
Hält's aus hier
Beiträge: 8

Win98
Delphi 7
BeitragVerfasst: Do 18.03.04 17:01 
und die Klammerung war doch richtig, man musste nur Dereferenzierung vornehmen! :lol:

_________________
Virchov
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Do 18.03.04 21:33 
Virchov hat folgendes geschrieben:
und die Klammerung war doch richtig, man musste nur Dereferenzierung vornehmen! :lol:
Ja, die Klammerung war in jeder Hinsicht vollkommen fehlerfrei. Sie war nur vielleicht nicht gut strukturiert, aber jeder klammert wie er will und es für richtig hält (siehe diverse C-Quellcodes :mrgreen:)-

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert