matchText error -> Handler can't find handler
Posted: Thu Apr 21, 2011 9:21 pm
I recently bought LiveCode, while building a Twitter desktop application I'm having issues with matchText and replaceText function. I browsed through the forum, copy, pasting and adapting a bit the code.
Forum is preventing me of posting an twitter profile example, so replace "twitter" with the any twitter profile
When the user presses the button, the script download the select Twitter profile, isolate tweets and probably will display it in a field
Problem is matchText and replaceText are firing a Handler can't find handler error.
Since matchText was firing the same error, I changed the code and add all the cleaning statements plus the replaceText function
This line
or this line
when used are both triggering the handler's error.
The ideal thing was to use the matchText function, extracting the data I want with a regular expression. When used it triggered the same error.
Forum is preventing me of posting an twitter profile example, so replace "twitter" with the any twitter profile
Code: Select all
on mouseUp
put URL "twitter" into field Logs
put empty into field Tweets
put "<span class=" & quote & "entry-content" & quote & ">" into myExpression
repeat for each line thisLine in field Logs
if myExpression is in thisLine then
put word 1 to -1 of thisLine into thisLine
replace myExpression with empty in thisLine
replace "</span>" with empty in thisLine
replace "</a>" with empty in thisLine
replaceText (thisLine,"<a\sclass=(.*)>",empty)
put thisLine & cr after field Tweets
end if
end repeat
end mouseUp
Problem is matchText and replaceText are firing a Handler can't find handler error.
Since matchText was firing the same error, I changed the code and add all the cleaning statements plus the replaceText function
This line
Code: Select all
replaceText (thisLine,"<a\sclass=(.*)>",empty)
Code: Select all
replaceText (thisLine,"<a class=(.*)>",empty)
The ideal thing was to use the matchText function, extracting the data I want with a regular expression. When used it triggered the same error.