<?xml version="1.0" encoding="UTF-8"?>
<test id="wmlscript/core/functions/declaration/2" class="A" scope="wmlscript" testtype="application" type="auto" source="wmls11#6.4.1" device="both">
  <assertion>Function parameters are local variables that have been initialized before the execution of the function body. As for any other variable, they loose their value at the end of the function.
</assertion>
  <notes>See core/variables/scope/3.</notes>
  <results>
    <result>
      <name>test</name>
      <value>pass</value>
    </result>
  </results>
  <method>
    <![CDATA[<card newcontext="true" id="main">
<onevent type="onenterforward">
<go href="<script1>#main('test','card1')">
<setvar name="test" value="fail"/>
</go>
</onevent>
<auto_failed>
</card>]]>
  </method>
  <cards>
    <card id="1">
      <![CDATA[<card id="card1">
<onevent type="onenterforward">
<go href="<resulturl>">
<postfield name="test" value="$test"/>
<sessionvars>
</go>
</onevent>
<auto_failed>
</card>
]]>
    </card>
  </cards>
  <scripts>
    <script id="1">
      <![CDATA[extern function main(myvar, next) {
	var result = 'pass';
	localfunc(result);	
	WMLBrowser.setVar(myvar, result);
	WMLBrowser.go('#' + next);
	return 1;
}

function localfunc(result) {
        result = 'fail';
        return;
}

]]>
    </script>
  </scripts>
</test>

