SWITCH1

SWITCH1 N

CREATES A SYSTEM OBJECT SWITCH1 AND ALLOCATES IT NUMBER N AS REFERENCE

  • Type: Command
  • Parameter: 1
  • Group: System Objects Creation

ACTION

The command SWITCH1 N creates a system object SWITCH1, and allocates it a number N. The number N will be used to designate the SWITCH1.

The created SWITCH1 can then be used through the appropriated commands. Its status is read by CHECKED() and the display can be changed by example by CAPTION N,"ON" or CAPTION N,"ON|OFF"

The SWITCH1 is created at position (0,0) : that is TOP = 0 pixel and LEFT = 0 pixel, with dimensions WIDTH = 75 pixels and HEIGHT = 25 pixels.

A SWITCH1 is a mean for the user to trigger an action.

A SWITCH1 can generate the event : ON_CLICK.

Remark : by default, the SWITCH1 is created on the FORM number 0, but another FORM can be used. For that, create a FORM by FORM N, and send it all the commands by COMMAND_TARGET_IS N before creating the SWITCH1.

SYNTAX: SWITCH1 N

  • N = system object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.

USE

  • A SWITCH1 is used in order that the user can input a binary information (ON or OFF).

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of system objects.
  • If number N is less than or equal to 0.
  • If number N is already used for a system object number.

EXAMPLE

rem create a SWITCH1 with default position and dimensions

switch1 1

width 1,210

height 1,100

caption 1, "***ON***|***OFF***"

SEE ALSO

CAPTION

TOP

LEFT

WIDTH

HEIGHT

FULL_SPACE

ON_CLICK