Page 1 of 1

matchText can't find handler error...

Posted: Tue Feb 24, 2015 7:12 pm
by tjo7777
I am trying to use matchText in a button script. The code looks like this:

Code: Select all

on MouseUp
   put line 25 of field "PlayerList" into playerlistline
   put playerlistline into line 1 of field "TestField"
   matchText(playerlistline,"name (player)",sc1)
   put sc1 into line 2 of field "TestField"
end MouseUp
When I run this it will put the variable playerlistline into field "TestField". I just did this to confirm the variable is being populated and can be added to TestField.

When it gets to the matchText line I get the error message: "button "AddButton": execution error at line 7 (Handler: can't find handler) near "matchText", char 1"

I read the section on handlers in the User Guide, but I am still not clear as to why LiveCode "can't find handler" in this instance.

Any assistance or advice is greatly appreciated,

TJ.

Re: matchText can't find handler error...

Posted: Tue Feb 24, 2015 7:17 pm
by Klaus
Hi TJ,

well, matchtext() is a FUNCTION and not a handler! :D

Use it like this:
...
get matchText(playerlistline,"name (player)",sc1)
...


Best

Klaus

Re: matchText can't find handler error...

Posted: Tue Feb 24, 2015 7:31 pm
by tjo7777
Thank you Klaus for your speedy reply and accurate answer.

It is very much appreciated! :D

TJ.