How to find the offset of the first character in a string that's not a tab?

Bob Sneidar bobsneidar at
Fri Jan 22 18:58:43 EST 2021

I did not know this! Isn’t anyone else shocked and surprised??

Bob S

On Jan 22, 2021, at 2:33 PM, Ken Ray via use-livecode <use-livecode at<mailto:use-livecode at>> wrote:

On Jan 21, 2021, at 8:36 AM, Keith Clarke via use-livecode <use-livecode at<mailto:use-livecode at>> wrote:

Thanks Brian. I looked at matchChunk in the dictionary & it seems to return a boolean, rather than the offset.

The boolean is just whether or not the matchChunk operation was successful; you need to provide variables for the start and end character offsets in the function call:

if matchChunk(myString,"([^\t])",tStart,tEnd) then
 put "The offset to the first non-tab character is:" && tStart
 -- matchChunk had an error because the regex was bad or something
end if

I know you've moved on, but just for the record...


Ken Ray
Sons of Thunder Software, Inc.

More information about the use-livecode mailing list