HP3000-L Archives

December 1996, Week 5

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:
Tue, 31 Dec 1996 15:18:00 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (56 lines)
On Dec 30, 12:49pm, Stigers, Gregory - ANDOVER wrote:
> Subject: HPAutoCont & HPContinue
> Our admin group uses some user defined command files peppered with
> CONTINUEs. I searched the LaserROM in vain for information on how to use
> HPAutoCont & HPContinue instead.
>
> 1) What is the difference between the two?

HPCONTINUE is a read-only boolean variable that indicates if a continue is
"active" for the next CI command.  HPCONTINUE is a pretty useless variable
and I probably should have deleted it long ago.  Useless because it is only
TRUE if the previously executed command was :CONTINUE or if HPAUTOCONT is
true.  In a script, HPCONTINUE cannot detect that the entire script may be
"protected" by a :continue -- it only knows if :continue was last command
executed.

HPAUTOCONT is a read-write boolean variable initially set to false.
When set to true HPAUTOCONT causes the CI to act as if every command
executed in a job or script is preceded by a :CONTINUE command.  There is
some overhead (I don't know how much but maybe it can be measured using
HPCPUMSECS) using HPAUTOCONT, because there is some overhead in executing
the :CONTINUE command.  Also, and probably more importantly, since HPAUTOCONT
is a job/session variable its value is persistent across all processes and
scripts in your job or session.  If you set it to true and forget to
reset it then all of your subsequent scripts will have auto-continue set.
This is a problem that will be solved with the new script-local (private)
variables enhancement being worked on right now.

> 2) I assume that to use these in command files (as opposed to job
> streams) we would want to set a placeholder variable to, say, HPAutoCont
> and set HPAutoCont to true, then execute our commands, and finally reset
> HPAutoCont back to the placeholder. Or is there a more elegant way to
> continue?

You are correct about saving the current HPAUTOCONT setting and then restoring
the saved value before your script terminates.  This approach is not
foolproof for a variety of reasons:
  1) your script may have several exit points and you may forget to reset it
in all exits
  2) your script may abort or have an error that causes it to exit unexpectedly
  3) the process running your script may be killed and so the script doesn't
have a chance to cleanup
  4) if <break> is allowed, your script might be <broken> and thus won't be
able to cleanup.

Until private CI vars are available I personally perfer to not use HPAUTOCONT.
I use explicit :CONTINUEs only on the commands that I expect may return
errors.  In conjunction to this, don't forget the ERRCLEAR and ESCAPE commands.
:ESCAPE allows you to propogate error codes up to the next :CONTINUE "marker".

I hope this helps some,

Jeff Vance, CSY

--

ATOM RSS1 RSS2