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?!
MaestroDaveAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DrDelphiCommented:
How about a sample of code in which you are reading this variable?

0
rwilson032697Commented:
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!

Cheers,

Raymond.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MaestroDaveAuthor Commented:
The (complete) code is huge - ie many .pas files. Let me work out what I need to send...
0
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!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.