Page 1 of 1

Problem with itemOffset() [SOLVED]

Posted: Sat Apr 05, 2014 8:26 am
by atout66
Hi to all,

Look at my code below, and try it in the commandWindow:

Code: Select all

put "603+,115,603,107,116" into laList
put "603" into leTest
answer itemOffset(leTest,laList)
You get "1" instead of "3".

Any idea how I could optimize this code ?

Kind regards.

Re: Problem with itemOffset()

Posted: Sat Apr 05, 2014 8:32 am
by Simon
put "603," into leTest

Re: Problem with itemOffset()

Posted: Sat Apr 05, 2014 8:33 am
by bn
Hi atout,
put "603+,115,603,107,116" into laList
put "603" into leTest
answer itemOffset(leTest,laList)
add "set the wholeMatches to true"

Code: Select all

 put "603+,115,603,107,116" into laList
   put "603" into leTest
   set the wholeMatches to true
   put  itemOffset(leTest,laList) into field 1
KInd regards
Bernd

Re: Problem with itemOffset()

Posted: Sat Apr 05, 2014 8:44 am
by atout66
add "set the wholeMatches to true"
You've got it Bernd :wink:
For a beginner like me, I could not guess such subtlety.
I'm sure some others will be glad to notice this trick...

Thanks to all of you.