manpagez: man pages & more
info mathgl
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.23 Program flow (MGL)

These commands control program flow, like, conditions, cycles, define script arguments and so on.

MGL command: call 'fname'

Executes script fname.

MGL command: chdir 'path'

Changes the current directory to path.

MGL command: define $N smth

Sets N-th script argument to smth. Note, that smth is used as is (with ‘'’ symbols if present).

MGL command: if dat 'cond'

Starts block which will be executed if dat satisfy to cond.

MGL command: if val

Starts block which will be executed if val is nonzero.

MGL command: elseif dat 'cond'

Starts block which will be executed if previous if or elseif is false and dat satisfy to cond.

MGL command: elseif val

Starts block which will be executed if previous if or elseif is false and val is nonzero.

MGL command: else

Starts block which will be executed if previous if or elseif is false.

MGL command: endif

Finishes if/elseif/else block.

MGL command: for $N v1 v2 [dv=1]

Starts cycle with N-th argument changing from v1 to v2 with the step dv.

MGL command: for $N dat

Starts cycle with N-th argument changing for dat values.

MGL command: next

Finishes for cycle.

MGL command: once val

The code between once on and once off will be executed only once. Useful for large data manipulation in programs like UDAV.

MGL command: stop

Terminate execution.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2026
Individual documents may contain additional copyright information.