Boolean Variables

A boolean variable is a single bit, and is a BOOL data type. A boolean variable can only exist within a DWORD variable.

Creating a Boolean Variable

To create a boolean variable, first define the variable as a DWORD. Then, expand the DWORD variable to see the bits. Each bit can be assigned a name.

Global Bits

If the DWORD variable itself has no name, then the bit names within it are global and the bit names can be used in expressions as they are.

Example:

The following DWORD has two named bits: myBit and yourBit.

These bits can be used directly in expressions, for example:

myBit := NOT yourBit;

Local Bits

If the DWORD variable has a name, then the bit names within it are local to that variable the bit names must be preceded by the name of the variable and a period.

Example:

The following DWORD has two named bits: myBit and yourBit.

In expressions, these bits must be used together with the name of the DWORD variable, for example:

MyBits.thisbit := NOT MyBits.thatBit;

 

See Also

Help Overview


Send comments on this topic.

Copyright © 2024 Delta Computer Systems, Inc. dba Delta Motion