State

state - run time read-only clause


SYNTAX (windows)

window_id->state


SYNTAX (objects)

[[window_id.]group_id.]object_id->state


The state clause is available for use with style flags (WS_ …) and with state flags (ST_ …) to retrieve an object’s current state. State is tested using the form:

object_id->state &

The bitwise and operator (&) is used rather than the equals to operator (=) because several states may be true at any one time. The clause evaluates to non-zero (TRUE) if the object is in the state being tested, otherwise zero (FALSE).

The states which may be tested for an object are listed in the state section on that object type.

NOTES

  • The state clause may not be used to update an object. Any attempt to do so is ignored.

  • Note the difference between state and style. The state clause retrieves the current state of an object. The style clause retrieves the initial style which was used when it was created and is used next time it is created, regardless of the current state of the object.

  • The state clause may also be used with a file_id to determine if a file is open, and if so in which mode. See File state; Keyed files, ![o]file, openfile.


EXAMPLES

if (Win3->state & WS_MINIMISED) then Max(Win3)
if (Button3->state & WS_INVISIBLE) then EnableBut(Button3)

RELATED TOPICS

Style

Window and window object style flags

Window and window object state flags