KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Turning check boxes on procedurally
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: March 7, 2003
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Compatibility: version 6.7.x and 6.8.x

Though a check box may indicate true or false to a user, a check box is not a Boolean variable, thus it does not get the Boolean value returned by the True function or the False function. Rather it gets a value of either 0 or 1.

A new developer recently inquired about how to turn a check box on procedurally. The following code had been placed in the Form Method, assigned to the On Load event.

ck:=True

This code failed to turn the check box on. Why? Because check boxes have a numeric value. By default they have a value of 0 when the check box is off, and they get a value of 1 when the check box is on. Therefore the correct code to turn the check box on would be

ck:=1