next up previous contents index
Next: Physical Actions Up: The MAD Program Previous: Program Flow Control

Subsections


Lines and Sequences

Sequences

The length of a SEQUENCE must now be given either on its header line or on the END line:

LHC: SEQUENCE, L=...;
   ...
END, L=...; // Do not use both ways to specify the length!!!
The preferred way is on the header line.

A SEQUENCE may now have arguments like an LINE:


S(X): SEQUENCE,L=10;
   SF.&X:SF,AT=2;
   X:QF,AT=5;
   OF.&X:OF,AT=8;
ENDSEQUENCE;
This half-cell may be instantiated with

S1:S(Q1);
giving the same effect as

S1: SEQUENCE,L=10;
   SF.Q1:SF,AT=2;
   Q1:QF,AT=5;
   OF.Q1:OF,AT=8;
ENDSEQUENCE;
Note the generated names.

A LINE or SEQUENCE can now be nested within a SEQUENCE. If the nested objects have arguments, their use causes an instantiation.


LHC: SEQUENCE, L=...;
   ...
   S(QF1),AT=...;
   S(QD1),AT=...;
   ...
END



chris.iselin@cern.ch