Inaccesible value

Posted on 1999-07-20
Medium Priority
Last Modified: 2010-04-06
can anyone tell me what is causing the variable become inccesible value
Question by:Explorer060599
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1389962
I have this problem when optimization is turned on. Trying to view a variable that has gone out of scope will also do this.

Accepted Solution

lz earned 200 total points
ID: 1389963
When optimization is turned on, the compiler does things
that are not obvious from the pascal lines you have written. For example, when you use a local variable only in the first
three lines of a procedure that is 20 lines long, the
compiler might detect that this value is not required
any more (altough YOU might want to see in the debugger)
and could (for example) re-use the processor register that
where it was stored for some other variable. In reality,
this is far more complex than this example, and cannot be easily predicted. The same applies for variables that go out of scope: the compiler does not need them as long as they are out of scope, so the code to make them available might
be removed by the compiler.
The one and only solution (applies to all compilers with
optimization, not just delphi): Turn optimization off
while debugging! In fact, optimized code can be so
complex to "understand" that debuggers sometimes
even have real problems when trying to step through optimized code (missing breakpoints etc.). You will
also see that you have much more "blue dots" where you
can place a breakpoint when optimization is off.


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question