Connecting one text field to another

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

ICCS_User
Posts: 12
Joined: Fri Dec 28, 2012 9:06 pm

Re: Connecting one text field to another

Post by ICCS_User » Mon Dec 31, 2012 10:09 pm

sturgis wrote:You've now turned the corner to a different problem. To accomplish your task you should probably look at filter.

This is untested, but something like:

Code: Select all

local tData

on mouseenter
   put fld "theData" into tData
end mouseenter

on keydown var
   put var after me 
   put empty into field "output"
   if me is  among the words of tData then
      put tData into tTemp -- put the data into a temp var
      filter tTemp with (me & space & "*") -- filter lines that don't start with your keyword
      repeat for each line tline in tTemp -- loop and place the remaining lines into the output field. 
           put word 2 of tLine & cr after field "output"
      end repeat
      delete the last char of field "output"
   end if
end keydown
At this point though it might be worth it to consider a database solution.
Wow! These few lines worked like a charm! Amazing! I haven't tried the other examples yet.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Connecting one text field to another

Post by Simon » Wed Jan 02, 2013 10:59 pm

Hi ICCS,
Thought of a new feature for you... Predictive text, in your search field, like Google does.
You have the basic code for doing it with the examples given. A few changes and some fancy field manipulation.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply