comp.lang.ada
 help / color / mirror / Atom feed
* VMS ADA - status return
@ 1993-04-22  0:34 Ian Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Williams @ 1993-04-22  0:34 UTC (permalink / raw)


Hi All,

I am a beginner ADA'er and am trying to have my program return non
successful error statuses in my exception handlers..
I have managed to raise the SAME exception in my handler, but this causes
a half page dialog of stack dump information which is really not what I wanted.

I simply want to be able to say something like this from DCL

$  myprog :== $mydir:myprog.exe
$  myprog param1 param2
$  if $status = errorval then etc.

How can I do this easilly?
How can I find values to pass to LIB$STOP and not cause access violations???

--
---------------------+-------------+-----------------------------------------
Ian Williams         |    _--_|\   |      Internet: iwilliam@au.oracle.com
Oracle Systems       |   /      \  |	  Phone	  : +61 8 239 3900
Adelaide, Australia  |   \_.--*_/  |
                     |         v   |

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: VMS ADA - status return
@ 1993-04-26 16:26 pa.dec.com!nntpd2.cxo.dec.com!etre!wallace
  0 siblings, 0 replies; 2+ messages in thread
From: pa.dec.com!nntpd2.cxo.dec.com!etre!wallace @ 1993-04-26 16:26 UTC (permalink / raw)


Ian Williams (iwilliam@au.oracle.com) wrote:
: Hi All,
: 
: I am a beginner ADA'er and am trying to have my program return non
: successful error statuses in my exception handlers..
: I have managed to raise the SAME exception in my handler, but this causes
: a half page dialog of stack dump information which is really not what I wante
d.
: 
: I simply want to be able to say something like this from DCL
: 
: $  myprog :== $mydir:myprog.exe
: $  myprog param1 param2
: $  if $status = errorval then etc.
: 
: How can I do this easilly?
: How can I find values to pass to LIB$STOP and not cause access violations???
: 
: --
: ---------------------+-------------+-----------------------------------------
: Ian Williams         |    _--_|\   |      Internet: iwilliam@au.oracle.com
: Oracle Systems       |   /      \  |	  Phone	  : +61 8 239 3900
: Adelaide, Australia  |   \_.--*_/  |
:                      |         v   |

Ian,
	Here's how it's done.

Aloha,
	Richard

Richard Wallace
Senior Software Engineer
Digital Equipment Corporation
301 Rockrimmon Blvd. South
CXO2-1/7A
Colorado Springs, CO 80919-2398
(719)548-2792
<wallace@cookie.enet.dec.com>

"The opinions expressed are my own, B.P. may not *quite* agree..."

-----------------------------------
-- Ada program
-----------------------------------
with STARLET;
use  STARLET;

with CONDITION_HANDLING;
use  CONDITION_HANDLING;
-- ++
-- What we're going to do here is raise an exception
-- and reraise it so that the program exits and DCL
-- gets the status return.  We'll check the status
-- return at the DCL level.
procedure EXCEPTION_GENERATION is
   REAL_BAD_EXCEPTION : exception;
   OTHER_EXCEPTION    : exception;
   SWITCH_VALUE       : INTEGER;

   EXIT_STATUS        : COND_VALUE_TYPE;
   CODE               : COND_VALUE_TYPE;

begin
   SWITCH_VALUE := 1;
   CODE         := 33;

   if SWITCH_VALUE = 3 then
      raise OTHER_EXCEPTION;
   elsif SWITCH_VALUE = 1 then
      raise REAL_BAD_EXCEPTION;
   end if;

exception
   when REAL_BAD_EXCEPTION =>
      EXI ( EXIT_STATUS, CODE );
      -- The EXIT_STATUS isn't checked as this
      -- VMS call transfers control directly
      -- from this code stream.

end EXCEPTION_GENERATION;

$!---------------------------------
$! DCL command procedure
$!--------------------------------
$! Test command procedure
$! Run the program and do something with the $STATUS
$! DCL runtime symbol.
$r/nodebug exception_generation
$if($STATUS .EQ. 33)
$then
$       write sys$output "something very bad has happened"
$endif
$exit 1
$eod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1993-04-26 16:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-04-22  0:34 VMS ADA - status return Ian Williams
  -- strict thread matches above, loose matches on Subject: below --
1993-04-26 16:26 pa.dec.com!nntpd2.cxo.dec.com!etre!wallace

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox