Unexplained Value Change
Posted on 2008-10-03
I am totally confused about something so am looking to you gurus for help in understanding. I realize there might not be a cut-and-dried answer but I really want to understand this.
I have a window with several combo boxes, checkboxes etc. It also uses Rave Reports with a custom connection. When you click a button a report is generated. When I enter the routine to open the custom connection the value of, say, the checkbox will say "checked" is false when it is "true". However, if I use the entire window name; for instance, MyForm.checkbox, it is reported correctly. I thought maybe I had some conflict in names so I named the checkbox to something totally nonsensical. Still happens. I even took everything off the window but a checkbox and buttons with minimum code and it still happens. No memory leaks are reported in ReportMemoryLeaksOnShutdown. I stepped through the code, even in the Rave report (nice code), and the global variable MyForm.checkbox is always correct.
So... why, on the window where the checkbox actually exists, would it be unable to report the value of a checkbox unless I have the entire window name attached? Since I have tracked this down I can work around it,however it makes me really uneasy. I would just like to understand. I use Delphi 2007 in Vista.
Any insight from you experts would be appreciated. Thanks.