Re: exit versus quit Behaviour in Begin-End Blocks

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue, 21 Aug 2007 07:39:05 -0600 (MDT)

All,

We are going to look at NCL's "exit" versus "quit" more closely and
see if we can't fix "exit"'s behavior so that it cleans up more
thoroughly. We may also use this opportunity to implement a new "exit"
type function that actually returns an error code. We've had a number
of requests for this.

I'm not sure what the correct behavior of "quit" is supposed to be. I
discovered just last week that it has not been documented. I've always
treated it as an interactive command, rather than one to use inside a
script, but I'm honestly not sure why.

I think "quit" is behaving as expected, but perhaps Dave Brown will
correct me on this. Meanwhile, we think "exit" is *not* behaving
correctly, and will try to remedy this. We will also document
"quit".

--Mary

On Mon, 20 Aug 2007, Lunde, Bruce N CIV NAVOCEANO, NP1 wrote:

> Hello,
>
> After discovering how "quit" cleans up better
> than "exit", I thought that "quit" would be a
> good replacement for "exit".
>
> However, it seems that if there is a "quit"
> within a begin-end block, then none of that
> block will be executed.
>
> It would be nice if "quit" (or some other command)
> would allow execution of the block up to the
> "quit" statement (i.e. until the logic encounters
> the "quit" statement) and then clean up "nicely".
>
> Below is a script which shows this behaviour.
> With "quit", the print statement in the block is
> never executed. Replace "quit" with "exit", and
> the statement will be executed.
>
> Thanks, Bruce
>
>
> print("BEFORE begin")
>
> begin
> print("INSIDE begin")
> quit
> end
>
> print("AFTER begin")
>
>
>
>
>
>
> =====
> Bruce Lunde
> Bruce.Lunde_at_navy.mil
> 228-688-5843
> Code NP1
> Naval Oceanographic Office
> Stennis Space Center, MS
> =====
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 21 2007 - 07:39:05 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 23 2007 - 15:57:17 MDT