Anchor Flags

Overview

Anchor flags can be used to alter the behavior of anchors. They can be applied to individual anchors through in-line anchor arguments, and to groups of anchors using the @flag anchors.

Anchor Flags

If you would like to apply one of these anchor flags to a specific anchor, you can do so by appending
--flag to the end of the anchor, where flag is replaced by the desired anchor flag

Anchor Flags

Example

Effect

nostop

# @output heading --nostop

Prevents the anchor from halting the code's execution when it encounters an anchor. This is primarily intended to be applied to outputs.

enable

# @output heading --enable

Enables the anchor if it was previously disabled. By default, all anchors are enabled.

disable

# @output heading --disable

Disables an anchor , making it have no impact, even when run in Artemis

Example 1: Using in-line anchors

# Example 1: Create a text output, but do not stop the code when it encounters it
z = 3
# @output heading data=z --nostop


# Example 2: Disable this text output so that it does not do anything
z = 3
# @output heading data=z --disable


# Example 3: Enable this text output in case it was disabled through other menas
z = 3
# @output heading data=z --enable

Group Anchor Flags

You can apply an anchor flag to all anchors with a specific a specific anchor tags using the @flag anchor.

Anchor Flags

Example

Effect

nostop

# @flag --nostop #tag1

Prevents code from stopping at all anchors with tag #tag1

enable

# @flag --enable #tag1

Enables all anchors with tag #tag1

disable

# @flag --disable #tag1

Disables all anchors with tag #tag1

Example 1: Using @flag to apply anchor flag to specific tags

# Example 1: Prevent code from stopping at all decorators with tags #tag1 and #tag2
# @flag --nostop #tag1 #tag2

# Example 2: Enable all decorators with tags #tag1 and #tag2
# @flag --enable #tag1 #tag2

# Example 3: Disable all decorators with tags #tag1 and #tag2
# @flag --disable #tag1 #tag2

Example 2: Using @flag to apply anchor flag to disable all anchors with tag #group-1

# Example: This disables all decorators with the tag #group-1
# @flag --disable #group-1

# This will be DISABLED since it has the #group-1 tag
a = 3
# @input number data=a #group-1 


# This will be DISABLED since it has the #group-1 tag
a = 3
# @input number data=a #group-1 #group-2 


# This will be ENABLED since it does not have the #group-1 tag
c = 3
# @input number data=c #group-2

Did this page help you?