<?xml version="1.0"?>
<!DOCTYPE sim SYSTEM "sim.dtd">
<!--
	Fourth test script
-->
<sim>

   <info>
   
   	<name	uid="autohit/test/scripts/working3">Working 3</name>
   	<version	num="1"/>
   	<note>
   		This script should actually work.
   		Test MATH(* and /), If, WHILE
   	</note>
   	<io>
   	</io>
   
   </info>
   
   <code>
	<call name="LOG"><set name="entry"
		value="TEST:GOOD:working3 start"/></call>
		
	<set name="Datestamp" value="0" new="new"/>
	<call name="DATE" result="Datestamp"></call>
	<call name="LOG">
		<set name="entry" eval="TEST:GOOD:working3:The datestamp is set as: $Datestamp$"/></call>

	<!-- MATH test -->
	<set name="Variable" value="10" new="new"/>
        <set name="Variable2" eval="1$Variable$"/>
        <math left="Variable" oper="*" value="2" output="destinationVar"/>
        <math left="Variable" oper="/" eval="$Variable2$" output="destinationVar2"/>
	<call name="LOG">
		<set name="entry" eval="TEST:GOOD:working3:The values for the variables are: Variable1=$Variable$ Variable2=$Variable2$"/></call>
	<call name="LOG">
		<set name="entry" eval="TEST:GOOD:working3:The values for dest vars are: destinationVar=$destinationVar$ destinationVar2=$destinationVar2$"/></call>

	<!-- WHILE and IF test -->
	<set name="rover" value="0" new="new"/>
	<set name="whileflag" value="1" new="new"/>
	<while name="whileflag" value="1">
       		<math left="rover" oper="+" value="1" output="rover"/>		
	        <if item="rover" value="10">
        		<set name="whileflag" value="0"/>
      			<call name="LOG">
				<set name="entry" eval="TEST:GOOD:working3:ROVER FLAGS end of while rover=$rover$"/></call>   		
       		</if>
		
	      	<call name="LOG">
		<set name="entry" eval="TEST:GOOD:working3:WHILE LOOP Rover=$rover$"/></call>   				
        </while>
		
	<!-- DONE -->				
	<call name="LOG">
		<set name="entry" value="TEST:GOOD:working3 done"/></call>		
	
   </code>

</sim>