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

Home » Public Forums » archive » Is n_params() supposed to behave this way?
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
Is n_params() supposed to behave this way? [message #16852] Mon, 23 August 1999 00:00
Mirko Vukovic is currently offline  Mirko Vukovic
Messages: 124
Registered: January 1996
Senior Member
Consider the following code:

pro sub1,arg1,arg2,arg3,arg4,arg5

message,/info,string(n_params())

return

end

pro sub,arg1,arg2,arg3,arg4,arg5

message,/info,string(n_params())

sub1,arg1,arg2,arg3,arg4,arg5

return
end

If at the command prompt I do

sub,4

IDL will print out
IDL> sub,4
% SUB: 1
% SUB1: 5

In sub1 all arguments except the first one are still undefined.

The problem arose in my application where I am initializing an object
whose identity is determined at run-time. Now, the number
of arguments that the objects need differs from one to the other,
and a single obj_new(ObjectName,arg1,arg2,arg3,,,) statement fails if
the init method for the object accepts only one argument (say).

Other than doing a case statement, is there some other way to
deal with this issue?

Thanks,

Mirko


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Newbie Question
Next Topic: Re: Unsupported X Windows visual???

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

Current Time: Wed Oct 08 15:09:57 PDT 2025

Total time taken to generate the page: 0.00497 seconds