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

Home » Public Forums » archive » External Development: Number of arguments
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
External Development: Number of arguments [message #93426] Tue, 12 July 2016 13:37 Go to next message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
I am cooking on another DLM. I need to check for the number of parameters passed into the routine but need to distinguish between regular arguments and keywords. The argc argument gives me the total but I do not know how to subtract the keyword count. There must be a simpler way of checking every single keyword as to whether it is supplied or not. Help greatly appreciated.

Thanks,
Haje
Re: External Development: Number of arguments [message #93427 is a reply to message #93426] Tue, 12 July 2016 17:11 Go to previous messageGo to next message
Jim  Pendleton is currently offline  Jim Pendleton
Messages: 165
Registered: November 2011
Senior Member
On Tuesday, July 12, 2016 at 2:37:48 PM UTC-6, Haje Korth wrote:
> I am cooking on another DLM. I need to check for the number of parameters passed into the routine but need to distinguish between regular arguments and keywords. The argc argument gives me the total but I do not know how to subtract the keyword count. There must be a simpler way of checking every single keyword as to whether it is supplied or not. Help greatly appreciated.
>
> Thanks,
> Haje

See the docs for the internal C function IDL_KWProcessByOffset.

Here's an example from the EDG:

http://www.harrisgeospatial.com/docs/KWExamples.html

Jim P.
Re: External Development: Number of arguments [message #93428 is a reply to message #93426] Wed, 13 July 2016 01:34 Go to previous messageGo to next message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 07/12/2016 10:37 PM, Haje Korth wrote:
> I am cooking on another DLM. I need to check for the number of
> parameters passed into the routine but need to distinguish between
> regular arguments and keywords. The argc argument gives me the total
> but I do not know how to subtract the keyword count. There must be a
> simpler way of checking every single keyword as to whether it is
> supplied or not. Help greatly appreciated.
consider using a wrapper which passes of the return of n_params()

That is maybe not optimal, but easy to do.
Re: External Development: Number of arguments [message #93431 is a reply to message #93426] Wed, 13 July 2016 12:04 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
On Tuesday, July 12, 2016 at 4:37:48 PM UTC-4, Haje Korth wrote:
> I am cooking on another DLM. I need to check for the number of parameters passed into the routine but need to distinguish between regular arguments and keywords. The argc argument gives me the total but I do not know how to subtract the keyword count. There must be a simpler way of checking every single keyword as to whether it is supplied or not. Help greatly appreciated.
>
> Thanks,
> Haje

Thank you for your replies. I had studied the IDL_KWProcessByOffset documentation and could not immediately retrieve the number of keyword using the function. I now simply add the nkw=sum(kw.there) flag, which are set to one if the keyword is set. Then I compute argc-nkw to get at the number of regular arguments.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: cfitsio library
Next Topic: extract (x,y) for every point of Curve in image

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

Current Time: Wed Oct 08 09:11:53 PDT 2025

Total time taken to generate the page: 0.00463 seconds