Autor Beitrag
FSS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 83

Win 7 Professional 64Bit
Delphi 7 PE, Delphi 2005 PE, Turbo Delphi Explorer 2006
BeitragVerfasst: Sa 03.06.06 19:32 
Hallo,
ich habe da ein Problem.

Ich habe bei einem Programm eine variable vom Typ Double unter public so deklariert:

ausblenden Delphi-Quelltext
1:
2:
3:
public
  test: Double;
end;


Die Variable steht unter public weil ich später mit einer anderen Form darauf zugreifen muss.
Nun will ich der Variable einen Wert geben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm_haupt.Button1Click(Sender: TObject);
begin
  test := 1;
end;


aus irgendeinem Grund nimmt die Variable den Wert nicht an, es kommt auch keine Fehlermeldung von Delphi. Weiß jemand woran das liegen könnte?

FSS
Moderiert von user profile iconjasocul: Code-Tags durch Delphi-Tags ersetzt
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Sa 03.06.06 19:36 
Das könnte ein Problem des Optimizers sein. Wenn du die Variable nirgendwo verwendest, wird es einfach weg-optimiert. Beim compilieren solltest du aber theoretisch einen Hinweis bekommen.
FSS Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 83

Win 7 Professional 64Bit
Delphi 7 PE, Delphi 2005 PE, Turbo Delphi Explorer 2006
BeitragVerfasst: So 04.06.06 17:11 
Naja, ich habe das Problem jetzt anders gelöst, ohne variablen. Jetzt ist es etwas umständlich und kompliziert aber es funktioniert.

FSS