![]() |
|
<?{> |
Longname: | ![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Released: | 4.55a | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Created: | 4.55a | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Last modified: | 5.54a | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See also: | <?}> <?:> { <?-> <?attr> |
Summary |
This command along with its sister commands <?}> & <?:>, allow movement within tags with gotos and labels, similar to the commands for moving around in scripts. Enables you to repeat commands or attributes, but can also be used to conditionally test text. |
Example extract |
The following syntax simply jumps over the plain text within this tag. This is not of much practical use but illustrates the basics of how jumps work.
|
Syntax
|
name or test:b
> |
name or test:b |
The command can take a number of different name generating syntax to point to a corresponding label. |
name or test:b |
|
name or test:b |
|
Example |
The following example will manipulate a text stream of capital letters so that any characters apart from the first of the word is in small capitals. It calls out a word space, re-inserts it with cap height, skips one character, inserts the small caps height, then jumps back to the label.
|
Example |
The example below tests the current value of the counter 99 to decide on what attributes to assign to the <Body> tag. If the counter x99 is 1, then jump to the label <?:red>, or if 2 jump to <?:blue>.
|
Example |
This test will simply jump to the label corresponding with the current counter value, whereas above, the label name was indicated.
|
The target label is allowed to be blank or it can point to a non-existent label (in which case the 'goto' command is ignored). This can be useful with conditional show strings. For example, if the counter 'a' contains the value 1, which indicates that a portion of the tag should be skipped, then the following could be used: |
Example |
If 'a' is not equal to 1 then the show string does not generate any text and so the target label is blank, causing the 'goto' command to be ignored.
|
![]() |
It is possible to set up continuous loops within a style. This is acceptable as long as a condition changes within the loop which will allow the loop to terminate. It is extremely easy to cause 3B2 to crash if loops are set up incorrectly. Consider the following: |
|
If 3B2 tries to format these commands, it will crash immediately as there is no exit condition for the loop. see <?-> |
Example |
A further example of this command's use is primarily used with SGML/XML type attribute tags. Strictly speaking a show string, this will jump to the label name set by the value of the 'role' attribute, in this case "default".
|
![]() |
A further example of this can be seen with the <?attr> command and conditional processing of show strings within attribute tags. This is discussed under the <?showifdef> & <?showifnum> command. |
Document created on 08-Feb-2003 (revision 1)