<?xml version="1.0" encoding="UTF-8"?>
<test id="wmlscriptlib/wmlbrowser/setvar/1" class="A" scope="wmlscriptlib" testtype="application" type="auto" source="wmlssl12#11.2" device="both">
  <assertion>When the WMLBrowser.setVar function is called with the parameters string
Name and string Value, the browser context variable Name is set to have the
value Value and the function returns true.
</assertion>
  <results>
    <result>
      <name>test</name>
      <value>pass</value>
    </result>
    <result>
      <name>value</name>
      <value>true</value>
    </result>
  </results>
  <strings>
    <string id="1">WMLBrowser.setVar('newvar', 'testit')
</string>
    <string id="2">WMLBrowser.getVar('newvar') == 'testit'
</string>
  </strings>
  <method>
    <![CDATA[<card newcontext="true" id="main"> <onevent type="onenterforward">
<go href="<script1>#main('test','card1')"/>
</onevent>
<auto_failed>
</card>]]>
  </method>
  <cards>
    <card id="1">
      <![CDATA[<card id="card1">
<onevent type="onenterforward">
<go href="<resulturl>">
<postfield name="test" value="$test"/>
<postfield name="value" value="$value"/>
<sessionvars>
</go>
</onevent>
<auto_failed>
</card>
]]>
    </card>
  </cards>
  <scripts>
    <script id="1">
      <![CDATA[extern function main(myvar,next) {
	var result = 'fail';
	var value = <string1>;

	if (value && <string2>) {
		result = 'pass';
	}
	WMLBrowser.setVar(myvar, result);
	WMLBrowser.setVar('value', value);
	WMLBrowser.go('#' + next);
	return 1;
}
]]>
    </script>
  </scripts>
</test>

