on using a runtime script block and matchtext.

Andre Garzia soapdog at mac.com
Sat Oct 23 14:09:58 EDT 2004


Hi Folks,

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[1], gInputA[...], gInputA[n]) 
into tBool

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[1], gInputA[2]) into 
tBool

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 
chunks?

Cheers
andre

PS: Malta or Bust!
-- 
Andre Alves Garzia ð 2004 ð BRAZIL
http://studio.soapdog.org



More information about the use-livecode mailing list