[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is n_params() supposed to behave this way?
- Subject: Is n_params() supposed to behave this way?
- From: Mirko Vukovic <mvukovic(at)taz.telusa.com>
- Date: Mon, 23 Aug 1999 19:36:08 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: Deja.com - Share what you know. Learn what you don't.
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:16257
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.