ParamListType

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

ParamListType

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

by johnmunro >> Thu, 16 Jan 2003 17:08:39 GMT

We want a multiple comparison operator, which would work something like:

if name.eq("John", "Munro", "FileVision") then
.....
endif;

where the eq method can take any number of parameters and returns whether the receiver is equal to any of the parameters.

The problem is that in order to do this we would need to create methods for:

eq2(comp1, comp2 : String): Boolean;
eq3(comp1, comp2, comp3 : String): Boolean;
eq4(comp1, comp2, comp3, comp4 : String): Boolean;
.....

and so on.

There is one thing in the Jade help file which looks like it could be the magic bullet to solve our problems - ParamListType.

Unfortunately, while the help file describes ParamListType in a way that makes it seem to be exactly what we want, it doesn't actually describe how to use it. ctrl+1 and ctrl+2 on a ParamListType parameter just cause an IDE exception.

Once we have created a method with the signature

eq(comp : ParamListType) : Boolean;

how do we go about getting the parameters out of it? How do we get a list of how many parameters were passed in?

If anyone has any idea how to use ParamListType, it would make our lives a lot easier in several areas of our system...

VB has optional parameters, grumble grumble...

:)

John Munro

---
Synergist Limited - Home of FileVision
The Bioscience Innovation Centre
Cowley Road, Cambridge, UK
CB4 0DS

Telephone: +44 (0) 1223 478200
Fax: +44 (0) 1223 477969
Email: john.munro@filevision.com
Web: http://www.filevision.com

The contents of this communication are confidential and are only intended to be read by the addressee. We apologize if you receive this communication in error and ask that you contact Synergist Limited immediately to arrange for its return. The use of any information contained in this communication by an unauthorized person is strictly prohibited. Synergist Limited cannot accept responsibility for the accuracy or completeness of this communication as it is being transmitted over a public network. If you suspect this message may have been intercepted or amended, please inform Synergist Limited.

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

Re: ParamListType

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

by allistar >> Thu, 16 Jan 2003 21:14:17 GMT

The interesting this is that if you do a:

test11(params: ParamListType);
//Allistar, 17 January 2003
//
vars
begin

write params;
end;

The call this method with whatever parameters you like it will write
the parameters out, separated by a CrLf pair. You can't, however, cast the params to a String. It seems that the "write" command has been developed to specifically handle for ParamListTypes.

Sorry I can't help, I'd be interested in knowing how you get along.

Overloading in C++ is a handy feature, one that would be nice in Jade.

Regards,
Allistar.

------------------------------------------------------------------
Allistar Melville
Software Developer
Auckland, NEW ZEALAND

Greentree International,
Developer of Greentree Financial Software. ------------------------------------------------------------------

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

Re: ParamListType

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

by cdshearer >> Fri, 17 Jan 2003 1:31:41 GMT

I don't think you're going to get very far here!

ParamListType is a pseudo-type. If you read the documentation it says that it can only be used in very specific circumstances!

In playing around with it, I even managed to provoke an exception in the editor when trying to access a list of properties and methods (using ctrl+1 and ctrl+2)...

I agree that method overloading is a much needed feature, as are parameterized constructors! Oh, and while they're at it, it would be nice if we had static methods too!

Craig

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

Re: ParamListType

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

by johnmunro >> Fri, 17 Jan 2003 11:48:48 GMT
I agree that method overloading is a much needed feature, as are parameterized constructors! Oh, and while they're at it, it would be nice if we had static methods too!

Yeah

Is there a Jade answer as to why they haven't/aren't going to do stuff like this? I imagine people have been asking for them for years...

John Munro

---
Synergist Limited - Home of FileVision
The Bioscience Innovation Centre
Cowley Road, Cambridge, UK
CB4 0DS

Telephone: +44 (0) 1223 478200
Fax: +44 (0) 1223 477969
Email: john.munro@filevision.com
Web: http://www.filevision.com

The contents of this communication are confidential and are only intended to be read by the addressee. We apologize if you receive this communication in error and ask that you contact Synergist Limited immediately to arrange for its return. The use of any information contained in this communication by an unauthorized person is strictly prohibited. Synergist Limited cannot accept responsibility for the accuracy or completeness of this communication as it is being transmitted over a public network. If you suspect this message may have been intercepted or amended, please inform Synergist Limited.

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

Re: ParamListType

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

by cdshearer >> Fri, 17 Jan 2003 1:34:26 GMT

One more thing, the documentation mentions that you can pass a variable number of parameters to an external method - I wonder if you could do some trickery in an external method that would extract the parameters and stick them somewhere (say in an ObjectArray - but you'd run into trouble because primitive types aren't objects!, and you can't define a collection of Anys)

Craig

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

Re: ParamListType

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

by allistar >> Fri, 17 Jan 2003 2:33:19 GMT

On Fri, 17 Jan 2003 1:34:26 GMT, craig.shearer@helix.co.nz (cdshearer) wrote:

You could just (gasp!) pass through one large comma delimited
parameter and break that up once inside your method.

Allistar.

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

Re: ParamListType

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

by cdshearer >> Fri, 17 Jan 2003 2:47:55 GMT

What a brilliant idea - maybe you should patent that! :-)

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

Re: ParamListType

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

by johnmunro >> Fri, 17 Jan 2003 11:49:58 GMT
You could just (gasp!) pass through one large comma delimited parameter and break that up once inside your method.

Yes, that's what we did as an interim while I tried to work out the ParamListType. It works, but it's just not... elegant...

:)

John Munro

---
Synergist Limited - Home of FileVision
The Bioscience Innovation Centre
Cowley Road, Cambridge, UK
CB4 0DS

Telephone: +44 (0) 1223 478200
Fax: +44 (0) 1223 477969
Email: john.munro@filevision.com
Web: http://www.filevision.com

The contents of this communication are confidential and are only intended to be read by the addressee. We apologize if you receive this communication in error and ask that you contact Synergist Limited immediately to arrange for its return. The use of any information contained in this communication by an unauthorized person is strictly prohibited. Synergist Limited cannot accept responsibility for the accuracy or completeness of this communication as it is being transmitted over a public network. If you suspect this message may have been intercepted or amended, please inform Synergist Limited.

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

Re: ParamListType

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

by johnmunro >> Fri, 17 Jan 2003 11:45:13 GMT

OK, I still don't know how to use ParamListType, so I can't apply it to other problems, but I've found a solution to this exact problem:

There is an unpublished method "isOneOf" defined on all primitive types which is exactly the method I was trying to create.

John Munro

---
Synergist Limited - Home of FileVision
The Bioscience Innovation Centre
Cowley Road, Cambridge, UK
CB4 0DS

Telephone: +44 (0) 1223 478200
Fax: +44 (0) 1223 477969
Email: john.munro@filevision.com
Web: http://www.filevision.com

The contents of this communication are confidential and are only intended to be read by the addressee. We apologize if you receive this communication in error and ask that you contact Synergist Limited immediately to arrange for its return. The use of any information contained in this communication by an unauthorized person is strictly prohibited. Synergist Limited cannot accept responsibility for the accuracy or completeness of this communication as it is being transmitted over a public network. If you suspect this message may have been intercepted or amended, please inform Synergist Limited.

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

Re: ParamListType

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

by torrie >> Mon, 20 Jan 2003 8:17:13 GMT

Hi

Anyone think that it would be a good idea to ask that that isOneOf method becomes a published method?

Torrie



==================================================
Original Message

2745: ParamListType
Newsgroup: JADE Tech General
From: johnmunro Date: 18 January 2003, 00:45:13
OK, I still don't know how to use ParamListType, so I can't apply it to other problems, but I've found a solution to this exact problem:

There is an unpublished method "isOneOf" defined on all primitive types which is exactly the method I was trying to create.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 20 guests