;***************************** ;* RoboTask Task file ;* Do not edit in text editor! ;***************************** [Root] ActionAfterRun=INTEGER|0 Actions=FOLDER Automat=INTEGER|-1 CatID=INTEGER|397884660 Comment=STRINGLIST ContinueOnError=INTEGER|0 ExternalName=STRING|"Task990" Hide=INTEGER|0 ID=INTEGER|4435042 LogOnAsUser=INTEGER|1 Name=STRING|"[DEMO] JS Evaluate demo" OnErrorTaskID=INTEGER|-1 Priority=INTEGER|3 RunOnClose=INTEGER|0 RunOnStartup=INTEGER|0 ToLog=INTEGER|3 WriteGeneralLog=INTEGER|0 [Actions] Action1=FOLDER Action2=FOLDER Action3=FOLDER [Actions\Action1] ActionID=STRING|"A_VARIABLES_SET" Enabled=INTEGER|-1 Name=STRING|"Set variable ""EXPRESSION"" with value ""sum(5,6) + multi(5.7, 8.99)""" Params=FOLDER [Actions\Action1\Params] expand=STRING|"0" varname=STRING|"EXPRESSION" varvalue=STRING|"sum(5,6) + multi(5.7, 8.99)" [Actions\Action2] ActionID=STRING|"A_SCRIPT_JSEVALUATE" Enabled=INTEGER|-1 Name=STRING|"JS Evaluate" Params=FOLDER [Actions\Action2\Params] expression=STRING|"{expression}" line00000000=STRING|"function sum(a, b)" line00000001=STRING|"{" line00000002=STRING|" return a+b;" line00000003=STRING|"}" line00000005=STRING|"function multi(a, b)" line00000006=STRING|"{" line00000007=STRING|" return a*b;" line00000008=STRING|"}" line0000000A=STRING|"function factorial(a)" line0000000B=STRING|" {" line0000000C=STRING|" if (a>30)" line0000000D=STRING|" { //this is synthetic limitation" line0000000E=STRING|" throw new Error(1, ""Parameter more than 30"");" line0000000F=STRING|" }" line00000010=STRING|" res = 1;" line00000011=STRING|" for (i=1; i<=a; i++)" line00000012=STRING|" {" line00000013=STRING|" res *= i;" line00000014=STRING|" }" line00000015=STRING|" return res;" line00000016=STRING|" }" linecount=STRING|"23" loadfromfile=STRING|"1" variable=STRING|"result" [Actions\Action3] ActionID=STRING|"A_DIALOG_MESSAGE" Enabled=INTEGER|-1 Name=STRING|"Show ""Expression: {Expression}""" Params=FOLDER [Actions\Action3\Params] icon=STRING|"1" msg0=STRING|"Expression: {Expression}" msg1=STRING|"Result is: {result}" msgcount=STRING|"2" playsound=STRING|"0" showmessage=STRING|"1"