WML <setvar> Tag

Advertisements


The <setvar> element is used as a result of the user executing some task. The >setvar> element can be used to set a variable's state within the following elements: <go>, <prev>, and <refresh>.

Attributes:

This element supports the following attributes:

AttributeValueDescription
namestringSets the name of the variable
valuestringSets the value of the variable
classclass dataSets a class name for the element.
idelement IDA unique ID for the element.

Example:

The following element would create a variable named a with a value of 1000:

<setvar name="a" value="1000"/>

Following is another example showing usage of this element.

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">

<wml> 
<card> 
<p>
 <anchor>
  Go to next chapter
  <go href="#chapter2"> 
   <setvar name="x" value="30"/> 
  </go>
 </anchor>
</p> 
</card>

</wml>


Advertisements
Advertisements