DiscusWare, LLC.
Download Purchase Contact Us
Home
Support Home Documentation Knowledge Base Support Forums Support Request Advanced Services
Discus Template Language :: Flow Control (Labels)

This document describes how to define labels within your templates and then skip ahead to them. Unless you hold a support contract that includes support for customization, DiscusWare does not provide support for the procedures in this section.
Support Site Search
 
Manuals and Docs
  Installation
  Upgrade
  Administration - 4.0
  Administration - 3.1
  Customization
    Skin Primer
    Skin Editing
    Interface Customization
    Templates: Variables
    Templates: Substitution
    Templates: IF-THEN
    Templates: FOREACH
    Templates: FOR
    Templates: DEFINE
    Templates: Arrays
    Templates: Skins
    Templates: Text Ops
    Templates: Subroutines
    Templates: Flow Control
    Templates: Math
    Templates: Global Options
    Templates: Colors
    Templates: Language Files
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.


Download Purchase Contact Us
Privacy Policy
Copyright © 2005, DiscusWare, LLC, All Rights Reserved