GOSUB |
"Gosub" is used to call a sub-programme at a given label.
Gosublabel [Fromnom_trt]
|
Element |
Description |
Restrictions |
|
label |
label may be preceded by the '$' character. |
Must be defined in the routine. |
nom_trt (1) (2) (3) |
nom_d'OBJet'=' expr_cstring |
|
|
nom_d'OBJet |
nom_d'OBJet indicating a routine |
It must exist. |
|
expr_c |
Char type expression whose result is a string |
|
string (1) (2) (3) |
nom_d'OBJetapplication"."nom_d'OBJetabsolute path of routine |
|
# Management programme that may be called by Gosub GESTION_ZONES
$GESTION_ZONESGosub INIT_ZONES
While 1Gosub SAISIE_CHOIX
Case [M]CHOIXWhen 'E' : Gosub EFFACE_ZONE
When 'F' : Gosub FIN_GESTION : Return
When 'M' : Gosub MODIF_ZONE
When 'C' : Gosub CREER_ZONE
When Default : Gosub ERREUR_CHOIX
Endcase Wend Return# The "SECUR" routine must be run from the first # reference application and no otherGosub ETIQ From =adxmother(0)+".SECUR"
"Gosub" is used to call a sub-programme, that may or may not be defined in the same routine. This sub-programme will be identified by a label. Its execution stops when the "Return" instruction is executed, and it hands over again to the instruction following " Gosub".
The instructions are executed schematically in the following sequence (the figures in parentheses giving the sequence):
(1) Gosub ETIQUETTE
|
(2) $ETIQUETTE (3) Sub-programme instructions (4) Return |
(5) Instructions AFTER Gosub
(6) End
A sub-programme called by "Gosub" must not end with an "End" but with an "Return".
|
Error |
Description |
|
PLUMEM (31) |
More memory (may occur in the event of Gosub recursive). |
|
ERRET (32) |
Return not corresponding with a Gosub (happens on Return). |
|
PAFIC (20) |
the routine does not exist, or is inaccessible. |
SUBPROG - GOTO - RETURN - CALL
|
|