Previous ION Script User's Guide: ION Script Tag Reference Next

ION Syntax Conventions

ION Script tags take one of the following two forms:

The following table lists which ION Script tags are tag pairs, and which are single tags:

 

Table 5-1: ION Script Tag Pairs 

Table 5-1: ION Script Tag Pairs 
Tag Pairs
Single Tags
<EVENTS> ... </EVENTS>
<EVENT_DECL />
<IDL> ... </IDL>
<ION_BUTTON />
<ION_BODY> ... </ION_BODY>
<ION_CHECKBOX />
<ION_DATA_OUT> ... </ION_DATA_OUT>
<ION_EVALUATE />
<ION_FORM> ... </ION_FORM>
<ION_ELSE />
<ION_HEADER> ... </ION_HEADER>
<ION_ELSEIF />
<ION_IF> ... </ION_IF>
<ION_INCLUDE />
<ION_IMAGE> ... </ION_IMAGE>
<ION_PARAM />
<ION_LINK> ... </ION_LINK>
<ION_RADIO />
<ION_OBJECT> ... </ION_OBJECT>
<ION_VARIABLE />
<ION_SCRIPT> ... </ION_SCRIPT>
<VARIABLE_DECL />
<VARIABLES> ... </VARIABLES>
 

Elements of Syntax

Each tag listed in this reference includes a "Syntax" section that defines how the tag is used. The following elements are used in syntax listings:

Table 5-2: ION Script Syntax Elements 

Table 5-2: ION Script Syntax Elements 
Element
Description
[ ] (Square brackets)
Indicates that the contents are optional.
Italics
Indicates arguments, expressions, or statements for which you must provide values.
{ } (Braces)
Indicates that you must choose one of the values they contain.
| (Vertical lines)
Separates values from which you must choose.

Consider the following syntax example:

<TAG ATTRIBUTE1="value" [ATTRIBUTE2="value"]
[ATTRIBUTE3={"value1" | "value2"}] >

content

</TAG>

In this example, ATTRIBUTE1 is required, while all other attributes are optional. ATTRIBUTE3 can be set to either value1 or value2.

Square Brackets ( [ ] )

Braces ( { } )

       <ION_EVALUATE EXPR="expression" [DISPLAY={"TRUE" | "FALSE"}] />

An example of a valid statement is:

<ION_EVALUATE EXPR="$X * 5" DISPLAY="TRUE" />  

 


Note
Braces are used in IDL to define a structure. When including IDL code as the value of an ION Script tag attribute or the content of an ION Script tag, braces that are part of the IDL code must be included. For example, the <IDL> tag might be used as follows:
<IDL> MyStructure = {a:1, b:2, c:3} </IDL>
In this case, the braces are included because they are part of the IDL syntax.

Italics

Case Sensitivity

ION Script is case-sensitive. All ION Script tags and attributes must be entered exactly as shown in this reference. User-defined variables must use consistent case as well. If you declare a variable as $A, you cannot refer to that variable using $a. System variables are not case-sensitive, except for $Browser system variables.

Using Quotation Marks

ION Script requires that values assigned to tag attributes be enclosed in double quotation marks, using the general form ATTRIBUTE="value".


Note
Carriage returns are not allowed between the double quotation marks that delimit the value of an ION Script attribute.

When the attribute is an expression (the EXPR attribute of ION_DATA_OUT or ION_IF), you will often need to mix numeric and string values. Strings can be enclosed in single quotation marks, which can be nested inside double quotation marks, as in the following example:

<ION_IF EXPR="$Name EQ 'Smith' ">  

Single quotation marks must also be nested inside double quotation marks whenever you assign a string literal as the value of an ION Script variable. For example, the following code shows the correct way to assign a string literal to the VALUE attribute of the VARIABLE_DECL tag:

<VARIABLE_DECL NAME="animal" TYPE="STR" VALUE="'dog'"/>  

 


Note
In an <IDL> block, you can use either single or double quotation marks to delimit a string. Note, however, that in IDL, a double quotation mark followed by a number has a special meaning. See Single vs. Double Quotation Marks.

Variable Substitution in Attribute Values

Many ION Script tag attributes can be set to values that contain explicit values and/or variables. For example, the EVENT attribute could be set in the following ways:

If an attribute can contain a variable, this fact is indicated in the attribute description.

HTML tag attributes can also contain variables, but you must insert the variable into the HTML attribute by using the ION_VARIABLE tag. For example, the HTML <FONT> tag could be specified as follows:

<ION_HEADER>  
<VARIABLES>  
   <VARIABLE_DECL NAME="FontColor" TYPE="STR" VALUE="'Red'"/>  
</VARIABLES>  
</ION_HEADER>  
<ION_BODY>  
   <FONT COLOR="<ION_VARIABLE NAME="$FontColor"/>">  
   This should be Red  
   </FONT>  
</ION_BODY>  

  IDL Online Help (March 06, 2007)