Thema: Delphi array of pointers

Einzelnen Beitrag anzeigen

Benutzerbild von JasonDX
JasonDX
(CodeLib-Manager)

Registriert seit: 5. Aug 2004
Ort: München
1.062 Beiträge
 
#8

Re: array of pointers

  Alt 24. Jun 2006, 19:11
Zitat von sk.Silvia:
the adress of ExportVar and Ratio is the same, thats OK
but why is the value of tmpr not same as the value of Ratio=ExportVar (the value of tmpr is 0 and the value of Ratio is 1,58 )?
On the left side of your Code you see a fiew blue points. In some lines these blue points are missing. This means, that this line of code has not been compiled, most times, because it was unnecessary. Here you're propably not using the variable temp anymore after the assignment, so it is unnecessary to execute that operation.
As short answer: the variable temp has the value 0, because the value has not been assigned for optimation reasons.
There are two ways to avoid this:
  1. you do something with the variable after the assignment. A ShowMessage(FloatToStr(temp)), for example.
  2. you disable compiler Optimation for the necessary lines of code, by using the {$O+/-}-Flags.

greetz
Mike
Mike
Passion is no replacement for reason
  Mit Zitat antworten Zitat