Hi guys, I am just new to Delphi and I am trying to learn some of components. I tried to add a checkbox and wanted to store its value to a certain variable.
Hi guys, I am just new to Delphi and I am trying to learn some of components. I tried to add a checkbox and wanted to store its value to a certain variable.
if checkbox1.Checked then BIT:=1; /// when i tried to run the program and trap into it, it would say that the variable is inaccessible due to optimization.
if checkbox1.Checked then BIT:=1; /// when i tried to run the program and trap into it, it would say that the variable is inaccessible due to optimization.
I can't remember the specifics, but I'm sure the optimizer is not as good as anyone can think it is. It tries to solve many general issues (and does a good job... sometimes), but never be as good as experience can teach you. As many have pointed, when debugging it should be off. And to avoid dependencies on the optimizer, a good programmer must learn programming patterns and algorithms. Programming is an art and a science, it's not just write code and compile.
ReplyDeleteHeinz Toskano Some code I have seen indeed was art... surreal art. ;)
ReplyDeleteYou need to use that BIT variable somewhere in your code.
ReplyDelete