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.

Comments

  1. 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.

    ReplyDelete
  2. Heinz Toskano Some code I have seen indeed was art... surreal art. ;)

    ReplyDelete
  3. You need to use that BIT variable somewhere in your code.

    ReplyDelete

Post a Comment