[Thread Prev][Thread Next][Index]

[ferret_users] BUG REPORT: Exiting from a script.



Hi,

http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/commands-reference/EXIT

Indicates that we should be able to exit a script to the next higher
level either via the general command EXIT or with the qualifier
EXIT/SCRIPT

However if executed within an IF statement with no ENDIF using EXIT
without a qualifier fails. IF blocks work as expected.

i.e.

!this fails to exit

if 1 then exit

!these work


if 1 then exit endif

if 1 then exit/script

if 1 then 
exit
endif

if 1 then 
exit/script
endif

---------------

russ-hf% ferret -nojnl
        NOAA/PMEL TMAP
        FERRET v6.82  
        Linux 2.6.32-279.1.1.el6.x86_64 64-bit - 08/03/12
        11-Sep-12 15:55     
--------------


Russ
! This should exit the script on failure of the first test.
! Instead it continues on and only exits with the /script qualifier or as part
! of a block

let test = 1
if `test` then exit
say Should not have gotten here since test =  `test`  but we did
!if `test` then exit/script  ! This also works
if `test` then
exit
endif
say Should not have gotten here since test =  `test`  and we did not.

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement