How to find the offset of the first character in a string that's not a tab?
Keith Clarke
keith.clarke at me.com
Thu Jan 21 09:36:46 EST 2021
Thanks Brian. I looked at matchChunk in the dictionary & it seems to return a boolean, rather than the offset.
Thanks all - I’ve stopped trying to find the syntax for ‘find any char but this’ in offset and instead, taken Dick’s advice to iterate through the chars and count the loops until char <> tab. :)
Best,
Keith
> On 21 Jan 2021, at 14:03, Brian Milby via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> You could also use matchChunk with a regular expression that excludes the tab character.
>
> Sent from my iPhone
>
>> On Jan 21, 2021, at 7:14 AM, Keith Clarke via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>> Ah yes indeed, I’d forgotten I could test with 'put not(tab)’ in the message box - that certainly proves the syntax was wrong! :-)
>> Best,
>> Keith
>>
>>>> On 21 Jan 2021, at 10:49, Dick Kriesel via use-livecode <use-livecode at lists.runrev.com> wrote:
>>>>
>>>>
>>>>
>>>>> On Jan 21, 2021, at 2:34 AM, Keith Clarke via use-livecode <use-livecode at lists.runrev.com> wrote:
>>>>
>>>> I was just keen to understand why offset wasn’t happy with the ‘not(tab)’ in this instance.
>>>
>>> expression "not(tab)" evaluates to true, which doesn’t serve your purpose
>>>
>>> — Dick
>>>
>>>
>>> _______________________________________________
>>> 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
>>
>> _______________________________________________
>> 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
>
> _______________________________________________
> 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