ON_SHOW

ON_SHOW N,L

EXECUTES THE PROGRAM FROM LABEL L WHEN THE SYSTEM OBJECT NUMBER N (FORM OR TAB) IS SHOWN

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

ACTION

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

The system object must of the type FORM or TAB.

SYNTAX: ON_SHOW 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_SHOW is used to associate an event (show) 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, TAB.
  • If the label L does not exist.
  • If L is not a correct label name.

EXAMPLE

label show,click

dim k%

k%=0

button 1:width 1,200:top 1,20:left 1,20:caption 1, "Click to hide this FORM"

on_show 0, show

on_click 1, click

end

show:

k%=k%+1

caption 0, "number of SHOWs: "+str$(k%)

return

click:

hide 0

wait 1000

show 0

return

SEE ALSO

FORM