There is some missing links here. I have gone over the manual thoroughly and cannot find anything on how to insert an argument into a user-defined JAL statement. In your example below you have JAL statements that are not complete. Is this how you get an argument into the statement? Statement - [Run,"",process_id] is missing a parameter - could that be argument 1? If so how does the statement know which argument to use where? Statement - [LoopWhile,END_LOOP] is missing a parameter - could that be argument 2? If so how does the statement know which parameter is missing and which argument to use? Statement - [Subtract,1,] is missing 2 parameters. If it is using the timeout argument, how does it know which argument to use? Both arguments have already been used. : You can wrap all this functionality in a single user-defined JAL statement : that simulates RunAndWait then you will call your statement instead of : RunAndWait. : This statement is not efficient as RunAndWait but can do the trick : One of the possible implementations for such statement is to run and monitor : the process, do something like the following: // this statement should : have at least 2 arguments: command line and timeout : // it also should return some value to indicate success/failure : Dim process_id, number : Dim temp, number : Run , "", process_id : LoopWhile , END_LOOP : // wait one second : Wait 1 : Subtract , 1, : // check whether the process is still running, : // if yes do another loop if it's not timed out : ProcessGetWindow process_id, temp : If temp, END_LOOP, FINISHED : END_LOOP: // timeout, kill the process : ProcessKill process_id : Return "TIMEOUT" : FINISHED: // process finished in time : return "FINISHED"
|