ParamListType method parameter

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

ParamListType method parameter

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:59 pm

by Darrell Duniam >> Thu, 4 May 2006 21:19:20 GMT

Him

We have a wrapper method which we use to invoke a transient method using process::executeTransientMethod.

The signature of our wrapper method is:

runHookLinkPublic(_hookType : Integer; _hookObject : CM_Object; _receiver : CM_Object; _paramListType : ParamListType) updating;

We are passing an instance of a subclass of a subclass of ObjectSet to the "_paramListType" parameter, but we get a compile error 6071 (Incompatible parameter type). According to the documentation, a ParamListType should map to a variable list of ANY type.

Would anyone have any idea why we are getting the compile error please ? We're using JADE version 6.0.24.

regards,
darrell.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: ParamListType method parameter

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:59 pm

by allistar >> Thu, 4 May 2006 21:44:18 GMT

Hi Darrell,
It's my understanding that you can't use the "ParamListType" type in your own methods - it's an internal Jade type. I've never been able to get it to work. It would allow a gludgeful way of implementing optional parameters on a method.

Allistar.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: ParamListType method parameter

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:59 pm

by Darrell Duniam >> Thu, 4 May 2006 22:02:16 GMT

Hi Allistar,

We've been using this parameter type for some time now, with no problems until now when I wanted to pass in an object set.

regards,
darrell.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: ParamListType method parameter

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:59 pm

by allistar >> Fri, 5 May 2006 1:55:48 GMT

Good to hear, I'll keep that in mind and many use it in the future.

Allistar.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: ParamListType method parameter

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:00 pm

by Darrell Duniam >> Fri, 5 May 2006 2:05:37 GMT

In JADE 6.1+, the ParamListType is fully supported, with methods to get the value(s) of parameters passed to the method being called.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: ParamListType method parameter

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:00 pm

by Darrell Duniam >> Fri, 5 May 2006 2:14:20 GMT

It turns out that all the problem was, is that I had left out a parameter when calling the method, so the compiler was quiet correct. That's what can happen when you don't scrutinize code that you copy & paste!!

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: ParamListType method parameter

Postby ConvertFromOldNGs » Fri Aug 07, 2009 1:00 pm

by Darrell Duniam >> Thu, 4 May 2006 22:42:54 GMT

I've worked it out, for non-primitive parameters, the parameters passed to the ParamListType must be an instance of the "_receiver" type or a subclass of that type, so by changing the "_receiver" parameter to type Object (rather than CM_Object), it now compiles :-)


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 13 guests