Performs logical branching in macros, i.e. jumping to a particular point in the macro.
JUMP(cond, "label")
cond |
- |
A scalar, the logical condition that must be true if the jump is to occur. |
"label" |
- |
A string. The label to jump to if condition is true. |
fft(W1); jump(mean(phase(curr)), "NEG"); echo("Positive"); jump(1, "END"); NEG: echo("Negative");END: label("Mean Phase")
is equivalent to:
fft(W1); if(mean(phase(curr)), echo("Negative"), echo("Positive"));label("Mean Phase")
In the JUMP statement, the label is in string form; at the branch point in the macro, the label is not quoted and followed by a colon.
GOTO is preferred in SPL routines.