• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 125
  • Last Modified:

Delphi thinks some values=0 but they are non-zero

This is nuts! I'm totally stumped. I have a variable which Delphi seems to sometimes think equals zero, when it definitely doesn't. If I output the value to a listbox on the screen, the value comes out correctly, and then from then on in the code (when debugging), its non-zero. If I don't output it to the screen it thinks it is zero!!!  Aaaaarrrrgghh! What is going on?!
  • 2
1 Solution
How about a sample of code in which you are reading this variable?

Sometimes the Delph Debugger 'lies' about the values of variables.

On the other hand, you may have an uninitialised variable which is acting in different ways given differnet environments.

And yes, some code would help!


MaestroDaveAuthor Commented:
The (complete) code is huge - ie many .pas files. Let me work out what I need to send...
MaestroDaveAuthor Commented:
aaaahhh - OK.  Sorry to waste your time! I was being a dick.  Well, a combination of me being a dick, and what Raymond said about the debugger 'lying' about variable values.

I had reset the variable's value to zero somewhere else in the code! But the debugger telling me it was zero, before it got reset to zero, just made everything confusing.

Cheers guys!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now