Autor Beitrag
DelphiMan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 73



BeitragVerfasst: Mo 20.01.03 17:45 
Hallo zusammen!
Wie kann ich eine Proecure erstellen, die auf den Zustand einer Booleschen Variable zugreift? Diese Procedure soll also jedesmal dann aufgerufen werden, wenn sich der Zustand einer Booleschen Variable x ändert, bspw. von FALSE nach TRUE.
Bitte um schnelle Antwort! Vielen Dank im Voraus!
MfG
DelphiMan
knightkiller
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

WinXP SP2
D7 Pers, D2005 Pers
BeitragVerfasst: Mo 20.01.03 18:41 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
[...]

type
  TForm1 = class(TForm)
  private
    FBoolean: Boolean;
    procedure SetMeinBoolean(const Value: Boolean);
    { Private declarations }
  public
    { Public declarations }
    property MeinBoolean : Boolean read FBoolean write SetMeinBoolean;
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.SetMeinBoolean(const Value: Boolean);
begin
  FBoolean := Value;
  //dein Code...
end;

[...]
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Mo 20.01.03 19:01 
nur mal zur erklärung des vorigen Posts:
Was knightkiller meint ist, dass du anstatt deine Booleanvar einfach zu ändern
ausblenden Quelltext
1:
boolvar:=true/false;					

eine Prozedur aufrufst
ausblenden Quelltext
1:
setmeinboolean(true/false);					

in der du dann deinen Wert änderst und wo du sofort danach noch deine anderen änderungen machen kannst..

Fiji-Fighter
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mo 20.01.03 19:48 
ich denke er will ein ereignis, wie bei einem button das onclick das eintritt wenn sich die variable ändert !!!

_________________
In the beginning was the word.
And the word was content-type: text/plain.
DelphiMan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 73



BeitragVerfasst: Mo 20.01.03 20:32 
Titel: Danke!!
Es klappt! super!
knightkiller
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

WinXP SP2
D7 Pers, D2005 Pers
BeitragVerfasst: Di 21.01.03 10:39 
Ich habe leider keine Zeit mehr gehabt meinen Code zu erklären, sonst wäre mir der Zug davongefahren...
Also was ich meinte:

Wenn du auf 'MeinBoolean' zugreiffst, wird der Wert von 'FBoolean' ausgelesen, und wenn du 'MeinBoolean' einen Wert zuweist wird die Procedure 'SetMainBoolean' aufgerufen, in welcher 'FBoolean' den zugewiesenen Wert bekommt. In der Procedure 'SetMainBoolean' kannst du jetzt dein Code einfügen, der aufgerufen werden soll, wenn man 'MeinBoolean' ändert.
Aber ändere NIE 'FBoolean' denn sonst wird das "Ereignis" 'SetMeinBoolean' nicht ausgelöst.

Alles Klar?

grus k_k