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

Home » Public Forums » archive » eval
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: eval [message #50509 is a reply to message #50392] Wed, 04 October 2006 22:36 Go to previous messageGo to previous message
Dominic Metzger is currently offline  Dominic Metzger
Messages: 30
Registered: August 2006
Member
Thank you for all your help.

_EXTRA definitely seems the way to go! :-)

I tried:
PRO LOG_OPENU, UNIT, FILE, _REF_EXTRA = ex
PRINT, 'OPENU'
OPENU, UNIT, FILE, _EXTRA=ex
END

and it seems to work. I guess I will try the strict version of _EXTRA
next.


Wayne Landsman: This might work in some cases but definitely not for
all.

Example wrapping spawn:

from the specs of spawn:
"If UNIT is present, Command must be present, and neither Result or
ErrResult are allowed."
http://idlastro.gsfc.nasa.gov/idl_html_help/SPAWN.html
In this case, one would have to check if UNIT was present or not...
thereby, a case statement is needed. Now, there a quite of few cases
like this. Therefore, the better approach seems to be the use of
_EXTRA.

best regards,

dometz



Wayne Landsman wrote:
> "Dometz" <dometz@gmail.com> wrote in message
> news:1159989739.132283.84940@i3g2000cwc.googlegroups.com...
>>
>> So for example for OPENU, I want to create a wrapper function that will
>> do some logging and the call the original OPENU:
>>
>> example:
>> PRO LOG_OPENU, UNIT, FILE, APPEND=APPEND, COMPRESS=COMPRESS,
>> BUFSIZE=BUFSIZE, DELETE=DELETE, ERROR=ERROR,
>> F77_UNFORMATTED=F77_UNFORMATTED, GET_LUN=GET_LUN, MORE=MORE,
>> NOEXPAND_PATH=NOEXPAND_PATH, STDIO=STDIO, SWAP_ENDIAN=SWAP_ENDIAN, $
>> SWAP_IF_BIG_ENDIAN=SWAP_IF_BIG_ENDIAN,
>> SWAP_IF_LITTLE_ENDIAN=SWAP_IF_LITTLE_ENDIAN, VAX_FLOAT=VAX_FLOAT,
>> WIDTH=WIDTH, XDR=XDR, RAWIO=RAWIO
>> print, FILE
>> print, SWAP_IF_BIG_ENDIAN
>> ;print etc...
>> ;Now here would like to call the original method but I have to call
>> it only with the named arguments that are set
>> OPENU, ...?
>>
>> So, either I could have a LOOOONG list of if or case statements or I
>> maybe I could use _EXTRA?
>
> _EXTRA is the way to go, but as a side note, you wouldn't have needed a long
> list of case statements but just a single call to OPENU with all the
> keywords present. OPENU will consider the keywords set only if they are
> present *and* have a non-zero value. So if they weren't defined in the
> call to the wrapper procedure, they won't be considered set by
> ENU. --Wayne
[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
Previous Topic: spawn on IDL virtual machine
Next Topic: .compile_opt strictarr is persistent?

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

Current Time: Sat Oct 11 13:16:30 PDT 2025

Total time taken to generate the page: 0.31862 seconds