comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Catched in a catch loop
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Catched in a catch loop [message #94800 is a reply to message #94799] Wed, 18 October 2017 07:10 Go to previous messageGo to previous message
Jim  Pendleton is currently offline  Jim Pendleton
Messages: 165
Registered: November 2011
Senior Member
On Wednesday, October 18, 2017 at 7:48:37 AM UTC-6, LNpellen wrote:
> I'm not used to CATCH - I strive to write the code robust enough to not cause errors. No I need it and seem to not understand how.
>
> Using RESTORE with a not valid save file causes
> % RESTORE: Not a valid save file:
>
> So I try with this catch, but the error occurs even though I get the dialog With the error-message I wrote (looping until I have to crash the program).
>
> What have I misunderstood?
>
>
>
> CATCH, err_stat
> IF err_stat NE 0 THEN BEGIN
> CATCH, /CANCEL
> sv=DIALOG_MESSAGE('Not valid .sav file: '+adr, /INFORMATION)
> ENDIF
> RESTORE, adr
>
>
>
> -Ellen

You will want a RETURN of some sort after your DIALOG_MESSAGE call otherwise the code will continue to run past the ENDIF statement. In this case it would execute the RESTORE a second time and stop.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: tvscl
Next Topic: tvscl

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:29:29 PDT 2025

Total time taken to generate the page: 0.00427 seconds