#Create a function with name RunProgram function RunProgram runner = new ProgramRunner() #Parameters to the function are in the array named afer the function name which is RunProgram in this case runner.system(RunProgram[0]) delete runner endfunction #Use of array of parameters and return value function CalculateValue win = new windows(); calc = win.waitfor("Calculator") i = 0 while i < arraylength(CalculateValue) do win.press(calc,CalculateValue[i]) i++ endwhile ret = win.readdouble(calc,0x193) delete win return ret endfunction function closeCalculator win = new windows(); calc = win.waitfor("Calculator") win.sendmessage(calc,"WM_CLOSE",0,0) delete win endfunction #return an array function returnArray a = 3 return 1,2,a,4,5 endfunction # The script will start execution here and will call RunProgtam function with # the parameter calc. This should result in the windows calculator being loaded RunProgram("calc") value = CalculateValue("5","-","6","=") assert(value == -1,"5 - 6 == -1") sleep(10) closeCalculator() array = returnArray() assert(array[0] == 1) assert(array[1] == 2) assert(array[2] == 3) assert(array[3] == 4) assert(array[4] == 5)