<?xml version="1.0" encoding="UTF-8"?>
<test id="wmlscript/core/variables/scope/1" class="A" scope="wmlscript" testtype="application" type="manual" source="wmls11#6.2.2" device="gateway">
  <assertion>The scope of a WMLScript variable starts where it is declared and is limited to the function in which it is declared.
</assertion>
  <results>
    <result>
      <name>submit</name>
      <value>yes</value>
    </result>
  </results>
  <method>
    <![CDATA[<card newcontext="true" id="main">
<p>The script referenced by this
&nbsp;<a href="<script1>#main('test','card1')">link</a>&nbsp;uses variables
before they are declared.</p>
<p mode="wrap">Did the browser report an error when trying to access the script?
<br />
<yesno>
</p>
</card>]]>
  </method>
  <cards>
    <card id="1">
      <![CDATA[<card id="card1">
<onevent type="onenterforward">
<go href="<resulturl>">
<postfield name="SUBMIT" value="no"/>
<sessionvars>
</go>
</onevent>
<auto_failed>
</card>
]]>
    </card>
  </cards>
  <scripts>
    <script id="1">
      <![CDATA[extern function main(myvar,next) {
	var result = 'fail';

	value = 5;

	var value;
	WMLBrowser.setVar(myvar, result);
	WMLBrowser.setVar('value', value);
	WMLBrowser.go("#"+next);
}
]]>
    </script>
  </scripts>
</test>

