Invalid SQL: INSERT INTO `swsessions` (`sessionid`, `ipaddress`, `lastactivity`, `useragent`, `isloggedin`, `sessiontype`, `typeid`, `dateline`, `status`) VALUES('5848cab262aaf61eccdfd21fa11f7902', '54.81.154.223', '1498227853', 'CCBot/2.0 (http://commoncrawl.org/faq/)', '0', '40', '0', '1498227853', '0'); (The table 'swsessions' is full)
Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\support.inm.com\includes\functions.php:410) in C:\Inetpub\support.inm.com\includes\functions.php on line 1612
Searching as you type in a database - Support Center
inm logo
Corporate Website | Contact | Store | Support | Login  
     


Knowledgebase
View categorized listing of all common frequently asked questions.
Downloads
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
Product:Platform:Area:Version:
INM V12 Database for DirectorWindows, MacintoshSearching and sorting3.x Regular & Light

Summary

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.

Example

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
        mSelectAll(gTable)
    else
        mSetCriteria(gTable, "Title", "Starts", x)
  end if
if CheckV12Error() then exit
    mSelect(gTable)
if CheckV12Error() then exit
   ShowSelection()
end

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"
end

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!

Sample


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