On 4/19/21 1:02 PM, Ken Ray wrote:
On Apr 19, 2021, at 1:47 PM, Mark Wieder via use-livecode <use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>> wrote:

On 4/19/21 11:04 AM, J. Landman Gay via use-livecode wrote:

I don't think lineoffset supports wildcards, but you could do it with matchChunk.

Ah! matchChunk and the the number of lines of... etc...
That should do it.

Another way to do it is to use 'filter' to get the text of the line that matches your wildcard, and then 'lineOffset' to find that line:

put tScript into tTemp
filter tTemp with ("local*" & tFunctionName & "*")
put lineOffset((cr & tTemp & cr),(cr & tScript & cr)) into tPos

Not sure if 'filter' is faster than 'matchChunk' when dealing with large scripts, but I have a feeling it might be...

Thanks, Ken.
I'll try benchmarking this against Jacque's suggestion of matchChunk. Filter is normally pretty fast, but I'll have to use the regex version, and I'm not sure what the speed implications will be.


--
 Mark Wieder
 ahsoftw...@gmail.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to