HP3000-L Archives

January 1997, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jeff Vance <[log in to unmask]>
Reply To:
Jeff Vance <[log in to unmask]>
Date:
Thu, 2 Jan 1997 13:22:50 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (55 lines)
Hi all,

Leonard Berkowitz asked me for a better description of the ESCAPE command
and with his permission here is my reply:

On Jan 2,  8:03am, [log in to unmask] wrote:
>> :ESCAPE allows you to propogate error codes up to the next :CONTINUE
>> "marker".

> What does this mean?  I find that :ESCAPE will terminate the job or
> command file.

The ESCAPE command (introduced in Release 2.1) causes the CI to execute its
error handling code as if a real error occured.  This means that the CI will
execute the command following the command protected by an active :CONTINUE,
or if no CONTINUE is active, the CI will terminate jobs and prompt sessions.
BTW, "active" continue means that a CONTINUE was just executed or a CONTINUE
command is protecting a script, eg.:
   continue
   xeq script

ESCAPE is probably most interesting when used in a script, although it is
useful for terminating jobs in an error state -- "REMAINDER OF JOB FLUSHED".

ESCAPE differs from the RETURN command in two ways:
  1) RETURN only exits back one level, whereas ESACAPE can exit out of
nested scripts,
  2) RETURN (currently) does not return a value, but ESCAPE can set the
CIERROR and HPCIERR CI variables.

Example:

  file1:
  -----
  cmd1
  continue
  cmd2 --->  cmd2:
             -----
             cmd2a
             cmd2b
             escape 999
  cmd3

In this example script1 executes script "cmd2".  If any command in "cmd2"
fails execution resumes back in "file1" at "cmd3".  This is also true if
"cmd2" invokes the ESCAPE command, as shown.  If "file1" did not have the
CONTINUE active then the ESCAPE in "cmd2" acts just like any other error:
terminates a job or re-issues the prompt for a session.  This example
also sets HPCIERR and CIERROR to 999, which "cmd3" could test.

regards,
Jeff Vance, CSY

--

ATOM RSS1 RSS2