Page 2 of 2

Re: Connecting one text field to another

Posted: Mon Dec 31, 2012 10:09 pm
by ICCS_User
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.

Re: Connecting one text field to another

Posted: Wed Jan 02, 2013 10:59 pm
by Simon
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