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

Home » Public Forums » archive » Re: main or procedure
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: main or procedure [message #54619 is a reply to message #54618] Wed, 20 June 2007 08:42 Go to previous messageGo to previous message
Conor is currently offline  Conor
Messages: 138
Registered: February 2007
Senior Member
On Jun 20, 10:56 am, David Fanning <n...@dfanning.com> wrote:
> Marshall Perrin writes:
>> It feels odd to disagree with the great Dr. Fanning, but in this case
>> I want to offer a counter-suggestion to the above advice.
>
> Actually, we probably don't disagree. I've pretty much
> given up EVER using ON_ERROR,1. If I need error handling,
> I typically use a CATCH.
>
> My impression was that the person asking the question
> was not very knowledgeable about IDL. I've learned it is
> better to start with the simple answers, rather than laying
> the whole sordid picture out all at once. I guess we could ask
> him. Sukye, did you understand ANYTHING Carsten Lechte said?
>
>> For the original poster: The reason it returned automatically to the
>> top level in your case is that you compiles a main routine (i.e.
>> a file with IDL code but no "PRO whatever" or "FUNCTION whatever")
>> while inside a procedure or function. That, you can't do.
>
> I don't think this is what happened, but perhaps it is the
> message that is confusing. This is the message
> you get if you crash in any IDL procedure or function
> and are stopped somewhere other than at the main level
> and you try to compile the same procedure or function that
> failed. I'd say this is 95% certain what has happened here.
> A simple RETALL would eliminate the message, but, of course,
> all variables created at that level would be lost. The good
> news, of course, is that you will re-discover all those
> variables you ACTUALLY created at the main level. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

That's what I assumed happened as well. When I first started using
IDL I had the exact opposite problem. I'd create all my variables and
what-not on the main level, and then my program would crash and all my
variables would dissappear. I had no idea what was going on, and no
one else I asked seemed to know either. It really irked me because I
was working with some large text files, and loading the data into IDL
was a particularly lengthy process (mainly because I had written a
horribly inefficient program that read the files into IDL). Every
time my program crashed I had to wait another 5 minutes for my data to
reload. Then, once it was done reloading, I would fix the bug and
recompile the program, bringing myself back to the main level and
restoring all the data I thought I had "lost" while I was in the
program scope. Of course I had already re-loaded the data, so I
didn't notice my missing data magically re-appearing when I re-
compiled my program, and I didn't know what the "procedure compiled
while active: returning' message meant, so I never realized what was
happening. I continued in this fashion for a couple weeks before I
finally figured out what was going on :)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Speed and array operations
Next Topic: memory for pixmaps: big vs many

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

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

Total time taken to generate the page: 0.00393 seconds