Macro Language Reference > Macros > Script - Instructions > {
  
{
Description
Instructs PTC ALD to jump backwards in a script by transferring control to the first occurrence in the script of the target : (label_script). Execution of the script then continues from the line that follows :.
 
{ can also be used to jump forward in the script, but only if there are no previous occurrences of the label.
 
Example 192. Re-execute part of a script via loops and jumps
If a certain section of a script had to be re-executed a number of times (looped), the following syntax could be used. As well as script actions, the ...script action(s)... section would also contain your exit condition(s):
:repeat_this
...script action(s)...
{repeat_this
 
Example 193. Jump backwards in a script to a variable
This example demonstrates jumping back to a variable, providing a conditional 'goto'.
{label_^var^
 
Example 194. Reset the value of variable arrays using loops, labels and jumps
This example illustrates the combined use of loops, labels and jumps in a small script that resets the values of a set of variable arrays:
^max_param=10
^param_array_incr=0
:set_param_vars
^param_array_incr++
?=^(^param_array_incr),^(^max_param) }exit_set_param_vars
^assd_com(^param_array_incr)=
^group_type(^param_array_incr)=
^param_nm(^param_array_incr)=
^param_typc(^param_array_incr)=
^param_descript(^param_array_incr)=
{set_param_vars
:exit_set_param_vars
Syntax
{ name:b
name
The name of the target :label to which to jump.
Additional Information
Label and jump macros are only available within scripts executed with trun since they are recognized only by the script processor, not the normal macro processor.
Jump macros must appear on a line by themselves unless they are part of a condition.
Related Links