Einzelnen Beitrag anzeigen

woki

Registriert seit: 29. Mär 2003
563 Beiträge
 
Delphi 2006 Architect
 
#17

Re: Hat Delphi Probleme mit static Variablen?

  Alt 30. Okt 2003, 09:21
Hi Frank,

ich kann allerdings Dein Problem nicht reproduzieren, hab das mal mit Booleans und mit Integern probiert, und bei mir gibt es keine Prozedurübergreifende Beeinflussung.

Delphi-Quellcode:
procedure TForm1.Button4Click(Sender: TObject);
const hallo : integer =2;
      testbool :Boolean=true;
begin
  hallo := hallo+1;
  ShowMessage(inttostr(hallo));
  testbool := NOT testbool;
  showmessage(BoolToStr(testbool,true));
end;

procedure TForm1.Button6Click(Sender: TObject);
const hallo : integer =2;
      testbool :Boolean=true;
begin
  hallo := hallo+1;
  ShowMessage(inttostr(hallo));
  showmessage(BoolToStr(testbool,true));
end;
[edit=Daniel B]Delphi-Tags korrigiert. Mfg, Daniel B[/edit]
  Mit Zitat antworten Zitat