ON_CHANGE

ON_CHANGE N,L

EXECUTES THE PROGRAM FROM LABEL L WHEN THE SYSTEM OBJECT NUMBER N HAS "CHANGED"

  • Type: Command
  • Parameters: 2
  • Group: Events

ACTION

The command ON_CHANGE N,L assigns a label (which must be defined in the program) from which the program will run every time the user changes something in the system object designated by the number N.

The system object must be one of the following types: MEMO, EDIT, COMBO, TRACK_BAR, SCROLL_BAR.

Remark : for a COMBO, the event corresponds to a change in its edition box: a COMBO is like an EDIT.

SYNTAX: ON_CHANGE N,L

  • 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.
  • L = label.

USE

  • The command ON_CHANGE is used to associate an event (CHANGE) happening to a system object, to a program location (defined by the label L).
  • When the event occurs, the program named by the label is executed.

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 0.
  • If system object number N does not exist.
  • If system object number N is not of the type : MEMO, EDIT, COMBO, TRACK_BAR, SCROLL_BAR.
  • If the label L does not exist.
  • If L is not a correct label name.

EXAMPLE

rem declare a label

label changed

rem a MEMO is created

memo 1

rem every time MEMO changes, execute from label "changed"

on_change 1,changed

end: rem main program is finished

changed:

beep: rem treatment of event = beep

return

SEE ALSO

MEMO

EDIT

COMBO

TRACK_BAR

SCROLL_BAR

ON_CLICK