Creating a Search Field

Andre.Bisseret Andre.Bisseret at inria.fr
Tue Apr 29 11:30:59 EDT 2008


I am not the right man to answer this question as, up to now, I never  
used any database :-)

I am pretty sure that if you populate the field to be search in (from  
a database or any other way) with short lines of text, then the  
handlers below are working as expected (a list shows up at each new  
char you type in the field  "entry" (like in mail on Mac when you type  
chars in the "To" field of a new message).

(In my case field "bigList" include a list of paires of words : first  
name and second name of persons (sometimes more than 2 words in case  
of composite first name and/or name)

But, I have not any idea about searching directly the database, I am  
sorry :-)
Best regards
André


Le 29 avr. 08 à 16:29, william humphrey a écrit :
> The fld "bigList" could be a dump of data from a SQL database or the  
> search
> code could be re-written to directly search the database?
> At what point is it better to put the database in a search field and  
> search
> that or use SQL directly and search the database?  With the goal  
> being a
> list of results that shows up instantly as you type in the search  
> field.
>
>
>>
>> I have three fields :
>> - one is the list to be searched in (say "bigList") -- this field  
>> could
>> have its visible property set to false
>> - a second is a one line field where the user write what he/she is
>> searching for (say "entry")
>> - the third is a field where the results of the search appears (say,
>> "results")
>>
>> the script of the  field "entry" is as follow :
>>
>> local mySubList,
>> ---------------------
>>
>> ON rawkeyUp
>>  find empty
>>   REPEAT
>>     find fld "entry" in fld "bigList" of this cd
>>     IF the result is "not found" THEN exit repeat
>>     ELSE
>>     put value(the foundline) & cr after mySubList
>>     END IF
>>   END repeat
>>   put empty into fld "results"
>>   put mySubList into fld "results"
>>   select char 2 to -1 of line 1 of fld "results"
>>   select after fld "entry"
>>   put empty into mySubList
>> END rawkeyUp
>>
>> ON returnInField
>> -- here do what you want with the found word
>> (I use the found word to find a corresponding card in another stack)
>> END returnInField
>>
>>
>>
>>
>>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>





More information about the Use-livecode mailing list