comp.lang.ada
 help / color / mirror / Atom feed
* Problem with function return
@ 2000-04-02  0:00 Amgarp
  2000-04-02  0:00 ` David Starner
  2000-04-03  0:00 ` A. Logue
  0 siblings, 2 replies; 7+ messages in thread
From: Amgarp @ 2000-04-02  0:00 UTC (permalink / raw)


Hi,

please help me with the following Problem:

Main programm:

type color is (red,gree,blue);

col:color;

col:=some_function(parameter);

Now, "some_function" returns of course a color type,
but when the parameter is bad(e.g. an empty string), an exception will be
raised.

What should the function return then?

Without a return statement in the e-handler there'll be a
Programm_Error.

Is there a way to prevent the line "col:=some_function(parameter);"
to be evaluated, or should it just return "some"(but of course wrong)
value?

Thanks!










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

end of thread, other threads:[~2000-04-03  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-02  0:00 Problem with function return Amgarp
2000-04-02  0:00 ` David Starner
2000-04-03  0:00 ` A. Logue
2000-04-02  0:00   ` Ray Blaak
2000-04-03  0:00     ` Robert Dewar
2000-04-03  0:00   ` Robert Dewar
2000-04-03  0:00     ` Mats Weber

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