ParamListType
Posted: 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.
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.