| index from sequence [message #734068] |
Thu, 06 October 2011 11:13  |
Fi Fi Messages: 126 Registered: March 2010 |
Senior Member |
|
|
Hi All,
I have a sequence of String like for example
Sequence('ax','ay','az')
I would define an helper that returns the index of an given parameter
for example
Sequence('ax','ay','az').my_helper('ax') --> 1
Sequence('ax','ay','az').my_helper('az') --> 3
please help me
thanks
|
|
|
|
| Re: index from sequence [message #734107 is a reply to message #734068] |
Thu, 06 October 2011 13:19   |
Ed Willink Messages: 3167 Registered: July 2009 |
Senior Member |
|
|
Hi
If you're trying to use OCL, Sequence literals use {} and Collection
operations use -> so try
Sequence{'ax','ay','az'}->indexOf('ax')
Regards
Ed Willink
On 06/10/2011 16:13, ZALILA Faiez wrote:
> Hi All,
> I have a sequence of String like for example
> Sequence('ax','ay','az')
> I would define an helper that returns the index of an given parameter
> for example
> Sequence('ax','ay','az').my_helper('ax') --> 1
> Sequence('ax','ay','az').my_helper('az') --> 3
>
> please help me
> thanks
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07412 seconds