Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 06.08.06 19:49 
ausblenden Delphi-Quelltext
1:
2:
FAlphaBlend := true;
showmessage(booltostr(FAlphaBlend));

Warum gibt man mir '-1'(false) aus?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
zuma
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 660
Erhaltene Danke: 21

Win XP, Win7, Win 8
D7 Enterprise, Delphi XE, Interbase (5 - XE)
BeitragVerfasst: So 06.08.06 19:57 
probier doch mal :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
FAlphaBlend := true;
if FAlphaBlend then
 showmessage('An')
else
 schowmessage('Aus');


ist FAlphaBlend dann auch auf aus, ist zumindest booltostr() nicht fehlerhaft.
ansonsten setz mal ein
Application.ProcessMessages;
zwischen die beiden Zeilen.
Mehr fällt mir dazu auch nicht ein

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt

_________________
Ich habe nichts gegen Fremde. Aber diese Fremden sind nicht von hier! (Methusalix)
Warum sich Sorgen ums Leben machen? Keiner überlebts!
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 06.08.06 20:00 
:eyecrazy: Jetzt gibt er 'An' aus.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
zuma
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 660
Erhaltene Danke: 21

Win XP, Win7, Win 8
D7 Enterprise, Delphi XE, Interbase (5 - XE)
BeitragVerfasst: So 06.08.06 20:04 
Also, booltostr überprüfen ...
oder einfach mal statt nur compilieren "Projekt erzeugen" anklicken ...
(hilft manchmal bei meinem D7)

_________________
Ich habe nichts gegen Fremde. Aber diese Fremden sind nicht von hier! (Methusalix)
Warum sich Sorgen ums Leben machen? Keiner überlebts!
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 06.08.06 20:06 
Deine Signatur trifft voll zu im Augenblick. ;)
Gut, es ist true. Aber später auf einmal false, obwohl ich nichts geändert habe (davon gehe ich zumindest aus...).

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
evilsoft.de
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 39

XP
Delphi 7
BeitragVerfasst: So 06.08.06 20:12 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  b: Boolean = False;
begin
  WriteLn(BoolToSTr(b));
  b := not b;
  WriteLn(BoolToStr(b));
  ReadLn;
end.


False ist immer 0, und True ist immer -1!

Wobei es wirklich verwirrend ist, nimm sonst die hier:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
Function BoolToStr(const b: Boolean):Char;
begin
  case b of
    True:  Result := '1';
    False: Result := '0';
  end;
end;
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 06.08.06 20:21 
:autsch: :autsch:
Ich habe die Variable in einer Procedure ALphaBlend genannt und Delphi ging davon aus, ich meinte Form1.AlphaBlend. Das ist natürlich false. :motz: Muss ich eben in AlphaBlending umbenennen.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 06.08.06 20:31 
Ich danke euch trotzdem für eure Hilfe!

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot