itemoffset & wholematches

Alex Tweedly alex at tweedly.net
Tue Nov 15 07:50:57 EST 2022


Hi,

I don't know if this will be faster, slower, or what !?! Something like ....

   put myVar into tCopy
   replace CR with TAB in tCopy

   put itemoffset("incertain", tCopy) into tmp
   put the number of chars in item 1 to (tmp-1) of tCopy into tCharCount
   put the number of items in char 1 to tCharCount of myVar into 
theRealAnswer


Or, depending on what you do next, just go on using charOffset rather 
than itemOffset for the following code.


Alex.

On 15/11/2022 09:33, jbv via use-livecode wrote:
> Hi guys,
> Thank you all for your answers.
>
> Actually I thought that some "hierarchy"remained (items inside lines)
> when using itemoffset, but obviously I was wrong.
> I have about 60000 variables to check, so I need my script to be as
> fast as possible. I use "replace CR with TAB & CR & TAB in ...", but
> as I need to get the exact itemoffset digit, I also need to count
> how many items I have added and substract that number from the
> result, which is quite cumbersome and slow...
>
> To Jacqueline :
> Thanks fro the suggestion, but I have to stick with items and
> itemoffset, for some items can contain more that 1 word, like
> "pied de biche"...
>
> Le 2022-11-14 14:45, Alex Tweedly via use-livecode a écrit :
>> That would deal with the last item in a line - but not the first.
>>
>> Should do
>>
>>    replace CR with TAB & CR & TAB in ...
>>
>> and reverse later if needed.
>>
>> Alex.
>>
>> On 14/11/2022 18:43, Bob Sneidar via use-livecode wrote:
>>> oic. Odd use case. I suppose a lineOffset function followed by is 
>>> among the items could be used. If he needs the lines to remain 
>>> intact he could also replace cr with tab & cr first.
>>>
>
>
> _______________________________________________
> 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