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

Home » Public Forums » archive » Re: IDL 8.0.1 ARG_PRESENT question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDL 8.0.1 ARG_PRESENT question [message #73696] Sun, 21 November 2010 10:15
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 11/21/10 10:15 AM, David Groff wrote:
> I call a method named assign like so:
>
> osrf->Assign, isrf[n], Debug=Debug
>
>
> In the assign method I see the following:
>
>
>
> PRO OSRF::Assign, $
> new, $ ; Output
> Debug=Debug ; Input keyword
>
> ; Set up
> ; ...OSRF parameters
> @osrf_parameters
> ; ...Set up error handler
> @osrf_pro_err_handler
>
> ; ...ALL *input* pointers must be associated
> IF ( self->Associated(Debug=Debug) EQ FALSE ) THEN $
> MESSAGE, 'Some or all input OSRF pointer members are NOT associated.', $
> NONAME=MsgSwitch, NOPRINT=MsgSwitch
>
> ; ...Return argument must be present
> IF ( NOT ARG_PRESENT(new) ) THEN $
> MESSAGE, 'No output object argument specified.', $
> NONAME=MsgSwitch, NOPRINT=MsgSwitch
>
>
>
> When I call the assign method as shown above I see the following error
> message:
>
> % WRITE_VIIRS_SRF: OSRF::LOAD_VIIRS: OSRF::ASSIGN: No output object
> argument specified.
> % Execution halted at: WRITE_VIIRS_SRF 10
> /usr2/trunk_new/scripts/idl/oSRF/lib/osrf_pro_err_handler.pr o
> % $MAIN$
>
>
> Adding a STOP just before the line where I see" IF ( NOT
> ARG_PRESENT(new) ) " in the assign method, I get the following from
> the idl prompt:
>
>
> IDL> help, new
> NEW OBJREF = <ObjHeapVar2770(OSRF)>
>
>
>
> Why does ARG_PRESENT(new) evaluate to FALSE?
>
> Thanks for any help in advance.

Because you didn't pass a named variable as the input parameter in your
call:

osrf->Assign, isrf[n], Debug=Debug

The expression `isrf[n]` is passed by value, so it cannot be changed
from within a called routine. (ARG_PRESENT tests whether a routine can
pass a value back to the calling routine.) Your call needs to look
something like:

; only needed if you are passing a value in, as well as out
isrfn = isrf[n]

; make the call with a named variable
osrf->Assign, isrfn, Debug=Debug

; put the temporary named variable's value where you want it
isrf[n] = isrfn

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL 8.0.1 ARG_PRESENT question
Next Topic: math

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

Current Time: Wed Oct 08 17:45:15 PDT 2025

Total time taken to generate the page: 0.00749 seconds