Invalid SQL: INSERT INTO `swsessions` (`sessionid`, `ipaddress`, `lastactivity`, `useragent`, `isloggedin`, `sessiontype`, `typeid`, `dateline`, `status`) VALUES('53457b0fdf562fc5489a242db80de59a', '54.81.157.56', '1503094518', 'CCBot/2.0 (http://commoncrawl.org/faq/)', '0', '40', '0', '1503094518', '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
Synchronize scrolling multiple database fields - 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 » Synchronize scrolling multiple database fields
Support Page Banner
 Synchronize scrolling multiple database fields
Product:Platform:Area:Version:
INM V12 Database for DirectorWindows, MacintoshInterface and data-handling3.x Regular & Light

Summary

It can be useful to allow a user to scroll database values in a field on the screen. This technote shows and explain a convenient way of displaying multiple fields of a V12 Database selection in multiple scrolling Director members while keeping them properly aligned and synchronized when the user browses through the selection.

Example

The secret resides in a clever use of mGetSelection. A single global variable is used to keep track of the number of the first record to display in the scrolling fields. For instance, let's imagine we have a "gTable" table opened, with two fields that we would like to scroll, "clothes" and "color".

First, we'll need two handlers that will create the selection each time the user clicks on an up or down arrow. The variable "gFirstRec" represent the first record to be shown.

on RecUp
-- Scroll one record up and refresh display
  if (gFirstRec = 1) then exit
     set gFirstRec = gFirstRec - 1
     ShowSelection()
end RecUp

on RecDown
-- Scroll one record down and refresh display
  if (gFirstRec >= mSelectCount(gTable) ) then exit
    set gFirstRec = gFirstRec + 1
    ShowSelection()
end RecDown

Next, the handler that will refresh the screen should look like the following script. The variable "kPageLenght" is a constant that remembers the number of record to show, depending on the 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, "clothes") into field "clotheslist"
    put mGetSelection(gTable, "LITERAL", gFirstRec, kPageLength, TAB, RETURN, "color") into field "colorlist"
end ShowSelection

To better comprehend this example, we recommend that you download the [free] sample available below and note that the scripts contained within are easily reusable in any Director movie!

Sample


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



Article Details
Article ID: 103
Created On: 26 Sep 2006 02:20 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