on using a runtime script block and matchtext.
soapdog at mac.com
Sat Oct 23 13:09:58 CDT 2004
I am building a litte expert system here who execute a couple regEx
calls, this calls are not hardcoded, meaning, I cannot predict the
RegEx expression that will be called. And I want all the (.*) to be put
inside an array called gInputA. So I have this function that will pick
the string with the RegEx expression, count the occurences of (.*) thus
determining how many keys the array will have, then it generates a
string/chunk with the following format:
put matchText(pText, theRegEx, gInputA, gInputA[...], gInputA[n])
Where n is the number of occurences of (.*). For example for a regular
expression "send (.*) to (.*)" it would generate a:
put matchText(pText, "send (.*) to (.*)", gInputA, gInputA) into
and put that into a chunk, then it would execute this chunk using "do"
(do tExpression). I receive a destination error, the one that says it
cannot put the values inside the array. The arrays is declared and used
before this chunk is assembled, if I take this array out, then the
script executes fine. My doubt is, there's a way for me to work this
array issue? should I go for matchChunk, then calculate and extract the
PS: Malta or Bust!
Andre Alves Garzia ð 2004 ð BRAZIL
More information about the use-livecode