<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 98.1p1 release (March 2nd, 1998) originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Interrupting Procedures</TITLE> <META NAME="description" CONTENT="Interrupting Procedures"> <META NAME="keywords" CONTENT="vol1"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <LINK REL="STYLESHEET" HREF="vol1.css"> <LINK REL="next" HREF="node46.html"> <LINK REL="previous" HREF="node44.html"> <LINK REL="up" HREF="node38.html"> <LINK REL="next" HREF="node46.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html1049" HREF="node46.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="icons.gif/next_motif.gif"></A> <A NAME="tex2html1045" HREF="node38.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="icons.gif/up_motif.gif"></A> <A NAME="tex2html1039" HREF="node44.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="icons.gif/previous_motif.gif"></A> <A NAME="tex2html1047" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="icons.gif/contents_motif.gif"></A> <A NAME="tex2html1048" HREF="node216.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="icons.gif/index_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html1050" HREF="node46.html">Entry points</A> <B> Up:</B> <A NAME="tex2html1046" HREF="node38.html">MIDAS Command Language</A> <B> Previous:</B> <A NAME="tex2html1040" HREF="node44.html">Special Functions</A> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION00667000000000000000"> </A><A NAME="2361"> </A> <BR> Interrupting Procedures </H2> <P> Sometimes, it may be necessary to interrupt the execution of procedures. One way to do this is via the command <TT>INQUIRE/KEYWORD</TT> 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. <BR> With the command <TT>PAUSE</TT> 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 <TT>CONTINUE</TT>. Then, the procedure continues with the next command after the <TT>PAUSE</TT> line. Only one procedure can be in the <TT>`PAUSEd'</TT> state at a time, in other words it is not possible to stop and save several procedures together. <BR> 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. <P> <BLOCKQUOTE> <TT>!+ <BR> ! Example 17, MIDAS procedure exa17.prg <BR> !+ <BR> DEFINE/PARAM P1 ? IMA "Enter input frame: " <BR> DEFINE/PARAM P2 ? IMA "Enter output frame: " <BR> DEFINE/MAXPAR 2 </TT>! max. 2 parameters expected<TT> <BR> WRITE/KEYWORD IN_A </TT><IMG WIDTH="17" HEIGHT="44" ALIGN="MIDDLE" BORDER="0" SRC="img172.gif" ALT="$\{$"><TT>P1</TT><IMG WIDTH="16" HEIGHT="44" ALIGN="MIDDLE" BORDER="0" SRC="img173.gif" ALT="$\}$"><TT> <BR> DEFINE/LOCAL MYRESULT/C/1/80 </TT><IMG WIDTH="17" HEIGHT="44" ALIGN="MIDDLE" BORDER="0" SRC="img174.gif" ALT="$\{$"><TT>P2</TT><IMG WIDTH="16" HEIGHT="44" ALIGN="MIDDLE" BORDER="0" SRC="img175.gif" ALT="$\}$"><TT> <BR> RUN tricky.exe <BR> PAUSE <BR> ! <BR> INQUIRE/KEYWORD INPUTC "Result frame o.k.? Enter YES or NO: " <BR> IF INPUTC(1:1) .EQ. "Y" THEN <BR> ASSIGN/DISPLAY LASER <BR> LOAD/IMAGE </TT><IMG WIDTH="17" HEIGHT="44" ALIGN="MIDDLE" BORDER="0" SRC="img176.gif" ALT="$\{$"><TT>MYRESULT</TT><IMG WIDTH="16" HEIGHT="44" ALIGN="MIDDLE" BORDER="0" SRC="img177.gif" ALT="$\}$"><TT> <BR> ENDIF <BR></TT></BLOCKQUOTE> <BR> With <TT>@@ exa17 venus jupiter</TT> the procedure will start the program <TT>tricky</TT> to operate on <TT>venus.bdf</TT> and produce the frame <TT>jupiter.bdf</TT>, and then it will stop. Now, you can check the result by e.g. calculating the statistics of <TT>jupiter.bdf</TT> or simply displaying it. Then, resume the procedure via <TT>CONTINUE</TT> and type <TT>YES</TT> if you are satisfied with the result and want the hardcopy or <TT>NO</TT> if not. <BR> Note also, that we used a local keyword to hold the name of the result frame and not the usual keyword <TT>OUT_A</TT>. Thus, we are sure that the result name is not accidentally overwritten by another command which also uses <TT>OUT_A</TT>. <P> <HR> <!--Navigation Panel--> <A NAME="tex2html1049" HREF="node46.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="icons.gif/next_motif.gif"></A> <A NAME="tex2html1045" HREF="node38.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="icons.gif/up_motif.gif"></A> <A NAME="tex2html1039" HREF="node44.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="icons.gif/previous_motif.gif"></A> <A NAME="tex2html1047" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="icons.gif/contents_motif.gif"></A> <A NAME="tex2html1048" HREF="node216.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="icons.gif/index_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html1050" HREF="node46.html">Entry points</A> <B> Up:</B> <A NAME="tex2html1046" HREF="node38.html">MIDAS Command Language</A> <B> Previous:</B> <A NAME="tex2html1040" HREF="node44.html">Special Functions</A> <!--End of Navigation Panel--> <ADDRESS> <I>Petra Nass</I> <BR><I>1999-06-09</I> </ADDRESS> </BODY> </HTML>