Elmomc Multi-Axis Motion Controller-Maestro Manuel d'utilisateur Page 86

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 313
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 85
5.5 Statements
MAXL statements are the program elements that control how and in what order
objects are manipulated.
MAXL statements are executed sequentially, except when an expression statement, a
selection statement, an iteration statement, or a jump statement specifically modifies
that sequence.
Syntax
statement
:
declaration-statement
labeled-statement
expression-statement
selection-statement
iteration-statement
jump-statement
5.5.1 Labeled Statements
To transfer program control directly to a given statement, the statement must be
labeled.
Syntax
labeled-statement
:
##identifier
statements
case (
expression)
statements
otherwise
statements
5.5.1.1
Maestro Software Manual MAXL Program Language
MAN-MASSW (Ver. Q)
Using Labels with the goto Statement
The appearance of an identifier label in the source program declares a label. Only a
goto statement can transfer control to an identifier label. The following code fragment
illustrates use of the goto statement and an identifier label to escape a nested loop:
Syntax
goto labeled-statement
labeled-statement
:
Example:
for ( i = 0 : 2 : 20 )
for( j = 2 : 16 )
if( i > j+10)
goto ##label
end if
end for
end for
## label
I=0
A label cannot appear by itself but must
always be attached to a statement.
The label has function scope and cannot
be re-declared within the function.
However, the same name can be used as a
label in different functions.
5-24
Vue de la page 85
1 2 ... 81 82 83 84 85 86 87 88 89 90 91 ... 312 313

Commentaires sur ces manuels

Pas de commentaire