inm logo
Corporate Website | Contact | Store | Support | Login  

View categorized listing of all common frequently asked questions.
View our categorized library of downloads for all necessary manuals, software, etc.
 Article Options
Support Center » Knowledgebase » INM V12 Database for Director » Searching as you type in a database
Support Page Banner
 Searching as you type in a database
INM V12 Database for DirectorWindows, MacintoshSearching and sorting3.x Regular & Light


It is possible to makes searches in a V12 Database file that are performed as the user types. This technotes explain how to implement a "MS-Help" search style to your movie.


The first thing to do is to open the database where the search will be performed. The movie stage should contain at least one field to show the values in which the search is being done, and another one where the user will be typing.

When a user types into the search field, use the "on KeyDown" handler to trap what the user types. Each time the user types a new character, call another handler that should look like the following one, where "x" represents the complete string contained in the field where the user is typing.

on LookInDB x
  if (length(x)=0) then
        mSetCriteria(gTable, "Title", "Starts", x)
  end if
if CheckV12Error() then exit
if CheckV12Error() then exit

Next, the ShowSelection handler should refresh the field on screen. Here, set the gFirstRec to 1 while "kPageLength" represents the number of records that should be shown at the same time in the field list, depending of field's height.

on ShowSelection
   -- Show kPageLength records of the current selection,
   -- starting at record number gFirstRec
   --  gTable must be valid upon entry of this handler
put  mGetSelection(gTable, "LITERAL", gFirstRec, kPageLength, TAB, RETURN, "Title") into field "FoundList"

For a better comprehension of this example, we recommend you to download the [free] sample available below and note that the included scripts are easily reusable in any Director movie!


This sample is supported on Director 6.5 and later. zip   sit

Article Details
Article ID: 102
Created On: 26 Sep 2006 02:18 PM

 This answer was helpful  This answer was not helpful

inm general footer
Services Xtras Go Products Support Gallery Store Download About Us Contact Newsroom