textchanged message

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
scottatbc
Posts: 2
Joined: Fri Jul 08, 2011 1:19 pm

textchanged message

Post by scottatbc »

Hi,

Did this not make the cut in 5.5? It's not in the dictionary and does not seem to work:

on textchanged mytext
put mytext into msg
end textchanged

has no apparent effect.

Thanks
Scott
sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: textchanged message

Post by sturgis »

Not in my dict either, but works fine. However, there is no parameter involved so while your script should actually be working its putting an empty value.

Do this instead

on textchanged
-- if you put the script in the card you can use the target to get the name or id of the changed field
put the long id of the target && random(1000) into msg -- random so you can see it fire after each keypress.
end textchanged

EDIT: Check out inputTextChanged. Its IOS specific but functionally pretty much the same as textchanged.
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10508
Joined: Wed May 06, 2009 2:28 pm

Re: textchanged message

Post by dunbarx »

Hi.

The release notes say nothing about an accompanying parameter. The message is simply sent whenever the text is changed.
You can always:

on textChanged
put me
put the value of the selectedLine
--or whatever
end textchanged
scottatbc
Posts: 2
Joined: Fri Jul 08, 2011 1:19 pm

Re: textchanged message

Post by scottatbc »

Ahh,

That's clear now - I was assuming a syntax like keydown.

Thanks to both of you!

Scott
Post Reply