From: "Andres Tarallo" <atarallo@chasque.apc.org.NOSPAM>
Subject: Re: Exiting from a function or procedure
Date: 2000/04/21
Date: 2000-04-21T00:00:00+00:00 [thread overview]
Message-ID: <sg2adl5pl6e8@corp.supernews.com> (raw)
In-Reply-To: rm0M4.39$t25.17152@news.pacbell.net
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1522 bytes --]
tmoran@bix.com escribi� en mensaje ...
>>this program i have a procedure that must do something if it's parameters
>>meet a certain condition; otherwhise it must exit.
> Do you mean the procedure must exit in the sense of return, or exit
>in the sense of stopping the program? Your C examples suggests the
>latter.
Thats the idea !!! when something goes wrong display a message
and stop.
> You could use "pragma import" on the C "exit" procedure and just
>call it, exactly as your C program does. Your code using an exception
>is fine except that it catches the exception, prints the error message,
>and then tries to drop out the bottom of the function without returning
>any value. You probably want to add a "raise;" statement after
>the Put, to re-raise the exception.
Ok, thanks for the advice, remember that this are my first
programas in ADA and still i'm not very familiar with the languaje.
> Note also that some compilers are only half-smart and will give a
>warning on the construct
>[..]
>because the compiler realizes that if the program takes the "else"
>branch it will drop out the bottom of the function without returning
>any value, but the compiler doesn't realize that some_exception will
>be raised and prevent reaching the bottom of the function.
It does give me a warning, but some thing do happen to some
C/C++ compilers so i didn't bothered in that message
Thanks
Andres Tarallo
next prev parent reply other threads:[~2000-04-21 0:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-21 0:00 Exiting from a function or procedure Andres Tarallo
2000-04-21 0:00 ` Robert A Duff
2000-04-21 0:00 ` tmoran
2000-04-21 0:00 ` Andres Tarallo [this message]
2000-04-22 0:00 ` Robert Dewar
2000-04-22 0:00 ` Ken Garlington
2000-04-22 0:00 ` tmoran
2000-04-22 0:00 ` Ray Blaak
2000-04-22 0:00 ` David Starner
2000-04-23 0:00 ` Robert Dewar
2000-04-23 0:00 ` tmoran
2000-04-24 0:00 ` Robert Dewar
2000-04-24 0:00 ` Robert Dewar
2000-04-24 0:00 ` tmoran
2000-04-24 0:00 ` Robert Dewar
2000-04-22 0:00 ` Pablo Moisset
2000-04-23 0:00 ` Robert Dewar
2000-04-24 0:00 ` Scott Ingram
2000-04-22 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox