Re: Arg_Present, XSurface, and Other Assorted B [message #9766 is a reply to message #9718] |
Tue, 12 August 1997 00:00  |
wmc
Messages: 117 Registered: February 1995
|
Senior Member |
|
|
In article e54555e6d6bd26f9896d3@news.frii.com, davidf@dfanning.com (David Fanning) writes:
> Catch, error
> IF error NE 0 THEN BEGIN ; Can't find LoadData.
> data = DIST(41)
> x = Findgen(41)
> y = Findgen(41)
> ENDIF
>
> IF Arg_Present(data) EQ 0 THEN BEGIN
> data = LoadData(2)
> ENDIF
> here is what happens.
> When the call is first made, "data" is not present and
> Arg_Present reports this correctly. The LoadData error occurs
> and I bounce up to my error handler. I define "data" and
> continue. But Arg_Present *STILL* reports data as missing
> in action. This is so even when it is defined AND a variable
> that is passed by reference. As a result, my code goes into
> an infinite loop.
Um, forgive me here, since I'm still an IDL 4 person... but it looks like
arg_present is behaving quite correctly in this case. arg_present is supposed
to tell you if "data" is passed as an argument, no? And it isn't, even when
you define it within the error routine. Or have I missed something here?
- William, "he's still on 4.0" (but our system people are working on it)
---
William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/public/icd/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
|
|
|