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: "
DEFINE/MAXPAR 2 ! max. 2 parameters expected
WRITE/KEYWORD IN_A P1
DEFINE/LOCAL MYRESULT/C/1/80 P2
RUN tricky.exe
PAUSE
!
INQUIRE/KEYWORD INPUTC "Result frame o.k.? Enter YES or NO: "
IF INPUTC(1:1) .EQ. "Y" THEN
ASSIGN/DISPLAY LASER
LOAD/IMAGE MYRESULT
ENDIF