next up previous contents index
Next: Entry points Up: MIDAS Command Language Previous: Special Functions

Interrupting Procedures

Sometimes, it may be necessary to interrupt the execution of procedures. One way to do this is via the command INQUIRE/KEYWORD which was already discussed before; depending upon the user input the procedure could continue or stop. But while the procedure is waiting for input, MIDAS is blocked, no other command can be executed.
With the command PAUSE a procedure is stopped and saved; MIDAS returns to the interactive level and you can execute any other command. To resume the stopped procedure at a later time, enter CONTINUE. Then, the procedure continues with the next command after the PAUSE line. Only one procedure can be in the `PAUSEd' state at a time, in other words it is not possible to stop and save several procedures together.
As an example, consider the case where after some tricky operations on an image you want to get a grayscale copy of the result on a Postscript Laser printer. Since the grayscale plot is quite a time consuming operation you want to make sure that the frame is really o.k. before sending that job to the printer queue.

! Example 17, MIDAS procedure exa17.prg
DEFINE/PARAM P1 ? IMA "Enter input frame: "
DEFINE/PARAM P2 ? IMA "Enter output frame: "
! max. 2 parameters expected
RUN tricky.exe
INQUIRE/KEYWORD INPUTC "Result frame o.k.? Enter YES or NO: "
With @@ exa17 venus jupiter the procedure will start the program tricky to operate on venus.bdf and produce the frame jupiter.bdf, and then it will stop. Now, you can check the result by e.g. calculating the statistics of jupiter.bdf or simply displaying it. Then, resume the procedure via CONTINUE and type YES if you are satisfied with the result and want the hardcopy or NO if not.
Note also, that we used a local keyword to hold the name of the result frame and not the usual keyword OUT_A. Thus, we are sure that the result name is not accidentally overwritten by another command which also uses OUT_A.

next up previous contents index
Next: Entry points Up: MIDAS Command Language Previous: Special Functions