Autor Beitrag
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Mo 14.10.02 16:29 
Hi

Was umhimmelwillen beduetet diese vom Compiler zurückgegebene Nachricht und was muss ich machen um diesem "Fehler" zu beheben?

[Warning] Unit???.pas(???): Variable 'variable' might not have been initialized

cu

Onz
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: Mo 14.10.02 16:42 
Erstmal ist das kein Fehler, sondern eine Warnung. :wink:

Diese Warnung tritt ein, wenn du eine Variable nicht "initialisiert" sondern direkt verwendest bzw. wenn der Variable nur bei einer bestimmten Situation ein Wert zugewiesen wird.

Ich hoffe, das hilft dir etwas. :mrgreen:

_________________
Viele Grüße
Jakob
Moritz M. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Mo 14.10.02 16:53 
Sodala

Nun hab ich das ganze mal mit Initialize(variable) versucht:

Und nun:

[Hint] Unit1.pas(208): Expression needs no Initialize/Finalize

Irgendwas versteh ich da nicht...

cu

Onz
aogwaba
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 109



BeitragVerfasst: Mo 14.10.02 17:12 
nee,
der Compiler mault, weil du die Variable zwar deklariert hast, ihr aber
keinen Startwert zugewiesen hast, der ist nähmlich bei nicht globalen
Variablen undefiniert.

Var variable:integer;
Variable:=0;

mehr nicht.

cu
waba
Moritz M. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Mo 14.10.02 17:14 
Hi

Danke. Nun klappts

cu

Onz