ON_ACTIVATE

ON_ACTIVATE N,L

EXECUTES THE PROGRAM FROM LABEL L WHEN THE SYSTEM OBJECT NUMBER N (FORM) IS ACTIVATED

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

ACTION

The command ON_ACTIVATE N,L assigns a label (which must be defined in the program) from which the program will run when the user activates the system object designated by the number N.

The system object must of the type FORM.

SYNTAX: ON_ACTIVATE 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_ACTIVATE is used to associate an event (activate) 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 : FORM.
  • If the label L does not exist.
  • If L is not a correct label name.

EXAMPLE

label active0,active1

dim k0%,k1%

k0%=0

k1%=0

height 0,200:width 0,300

alpha 10:top 10,20:left 10,20:caption 10, "Click on this FORM"

form 1:left 1,310:height 1,200:width 1,300

alpha 11:parent 11,1:top 11,20:left 11,20

on_activate 0,active0

on_activate 1,active1

end

active0:

k0%=k0%+1

caption 0, "activations: "+str$(k0%)+" : "+str$(NUMBER_ACTIVATE)

caption 10, ""

caption 11, "Click on this FORM"

return

active1:

k1%=k1%+1

caption 1, "activations: "+str$(k1%)+" : "+str$(NUMBER_ACTIVATE)

caption 10, "Cliquez sur ce FORM"

caption 11, ""

return

SEE ALSO

FORM