Chunked Off
Richmond Mathewson
richmondmathewson at gmail.com
Sat Sep 1 09:22:59 EDT 2018
Yup: a lot.
I've got a text, in a field ("xText"), that contains the phrase "Ruyton
of the Eleven Towns."
[ Don't worry why it is "Ruyton of the Eleven Towns.": just part of an
ongoing, slightly kinky relationship with someone at LC central. ]
Now . . .
I can do this sort of thing:
on mouseDown
put empty into fld "zText"
put fld "xText" into exTEXT
if matchChunk(exText,"Ruyton of the Eleven Towns.") then
--do something magical
end if
end mouseDown
And the matchChunk will prove positive . . .
Now what I would like to do is dlete the chunk "Ruyton of the Eleven Towns."
from the string variable . . . BUT . . . if I "try to be clever":
on mouseDown
put empty into fld "zText"
put fld "xText" into exTEXT
put "Ruyton of the Eleven Towns." into CHK
if matchChunk(exText,CHK) then
delete CHK from exTEXT
end if
end mouseDown
the coloured line throws a "big, bad, bluey".
Richmond.
More information about the use-livecode
mailing list