matchText can't find handler error...

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
tjo7777
Posts: 34
Joined: Fri May 02, 2014 9:16 pm

matchText can't find handler error...

Post by tjo7777 » Tue Feb 24, 2015 7:12 pm

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.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » Tue Feb 24, 2015 7:17 pm

Hi TJ,

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

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


Best

Klaus

tjo7777
Posts: 34
Joined: Fri May 02, 2014 9:16 pm

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

Post by tjo7777 » Tue Feb 24, 2015 7:31 pm

Thank you Klaus for your speedy reply and accurate answer.

It is very much appreciated! :D

TJ.

Post Reply