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

Home » Public Forums » archive » Re: DLM keyword processing
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: DLM keyword processing [message #41235] Thu, 14 October 2004 06:23
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Ok, never mind, I finally found the bug: I forgot to add the line
if (kw.tilt) IDL_StoreScalar(kw.tilt,IDL_TYP_DOUBLE,&itilt);
to my code. For some reason IDL is also really picky about where this has to
appear. Well, for some magical reason it works now. But this magic is
exactly why I will always prefer Fortran over C: C just controls me while I
can control Fortran. :-)

Haje

"Haje Korth" <noemail@address.com> wrote in message
news:cklpcc$elo$1@aplcore.jhuapl.edu...
> Good morning everyone,
>
> I am working on a DLM project and have some trouble with the keyword
> processing. Below is the relevant code that results in my problem, which
is:
> I want to call the routine from IDL as "geopack_recalc,tilt=xxx", so that
> xxx=999.0d on exit. This works fine if I define xxx before the call (e.g.,
> xxx=0). Is there a way to avoid having to define xxx before the call? This
> is an output keyword only, so there should not be a need to set the
variable
> before the call. Does anyone know how to do this?
>
> Thanks for your help,
>
> Haje
>
>
>
> void IDL_CDECL geopack_recalc(int argc, IDL_VPTR argv[], char *argk)
>
> {
>
> extern init;
>
> typedef struct {
>
> IDL_KW_RESULT_FIRST_FIELD;
>
> IDL_VPTR tilt;
>
> } KW_RESULT;
>
> static IDL_KW_PAR kw_pars[] = { IDL_KW_FAST_SCAN,
>
> {"TILT" ,IDL_TYP_UNDEF,1,IDL_KW_OUT|IDL_KW_ZERO,0,IDL_KW_OFFSETOF(ti lt)},
>
> {NULL}
>
> };
>
> KW_RESULT kw;
>
> double tilt;
>
> IDL_ALLTYPES itilt;
>
> IDL_KWProcessByOffset(argc,argv,argk,kw_pars,0,1,&kw);
>
> tilt=999.0;
>
> if (kw.tilt) {
>
> itilt.d=tilt;
>
> IDL_StoreScalar(kw.tilt, IDL_TYP_DOUBLE, &itilt);
>
> }
>
> init=1;
>
> IDL_KW_FREE;
>
> }
>
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: DLM keyword processing
Next Topic: errplot and plotting large data sets

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

Current Time: Sat Oct 11 03:37:27 PDT 2025

Total time taken to generate the page: 0.47921 seconds