1)
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1">
<p>
if else example
</p>
<do type="accept">
<go href="IfElseExample.wmls#findifelse()" />
</do>
</card>
<card id="card2">
<p>
rand is $(str)
</p>
</card>
</wml>
2)
extern function findifelse()
{
var str;
var rand = Lang.random(10000);
if(rand < 5000)
{
str = "less than 5000";
}
else
{
str = "NOT less than 5000";
}
WMLBrowser.setVar("str", str);
WMLBrowser.go("IfElseExample.wml#card2");
};
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1">
<p>
if else example
</p>
<do type="accept">
<go href="IfElseExample.wmls#findifelse()" />
</do>
</card>
<card id="card2">
<p>
rand is $(str)
</p>
</card>
</wml>
2)
extern function findifelse()
{
var str;
var rand = Lang.random(10000);
if(rand < 5000)
{
str = "less than 5000";
}
else
{
str = "NOT less than 5000";
}
WMLBrowser.setVar("str", str);
WMLBrowser.go("IfElseExample.wml#card2");
};
No comments:
Post a Comment