|
Synopsis
The Discus Template Language allows you to skip ahead to a predefined label. While it would be possible to achieve identical results with IF-THEN-ELSE blocks and by possibly repeating sections of code, skipping ahead allows this to be done much more cleanly.
You can skip ahead in the code using the skipto command. The label you are skipping ahead to is defined with the label command.
Hello there.
<#skipto "dest"#>
You better not print me!
<#label "dest"#>
At the destination!
Hello there.
At the destination!
Both the skipto command and the label definition must appear on their own lines (they cannot be on the same line as other text or an in-line IF-THEN-ELSE statement. An error will occur if you attempt to skip to a label that is not defined.
A few other rules for using label and skipto:
The name of the label as specified in the skipto command and the label definition must be alphanumeric. You cannot use variables within label names.
You can use the skipto command to skip ahead in text. You cannot skip backwards.
Skipping text literally ignores all text between the skipto command and the label definition. This includes all definitions.
You can't skip from one part of a skin into another part.
|