itemoffset & wholematches

Bob Sneidar bobsneidar at iotecdigital.com
Mon Nov 14 12:00:56 EST 2022


Why not just use is among the items? 

Bob S


> On Nov 14, 2022, at 04:51 , jbv via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi list,
> 
> I have a variable with a content of 3 lines as follows :
> 1	sombre	brun	profond
> 2	flou	incertain
> 3	inexploré	mystérieux	inconnu
> 
> The separator between words is tab.
> I want to check if a certain word is among the items as a whole.
> 
> The following script returns "6" :
>   set itemdel to tab
>   set the wholematches to false
>   put itemoffset("incertain",myVar)
> 
> The following script returns "0" :
>   set itemdel to tab
>   set the wholematches to true
>   put itemoffset("incertain",myVar)
> 
> The following script returns "7" :
>   set itemdel to tab
>   set the wholematches to true
>   replace return with tab in myVar
>   put itemoffset("incertain",myVar)
> 
> Scripts 1 & 3 are logical, but any logical explanation
> for the result of script 2 ? Does it mean that the return
> char after the word is considered as part of the word ?
> 
> Thanks in advance.
> jbv
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list