[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function            SCROLLER()
Action              Hotkey lookup tables with dbf storage
Returns
Category            Lookup
Syntax              SET KEY xxx TO SCROLLER
                    Scroller([expC1],[expN],[expC2],[expC3], ;
                             [expC4],[expC5],[expC6],[expC7])

Description         Scroller is primarily a hotkey lookup table
                    engine, although it can be called directly
                    as well. Scroller is data-driven (although
                    that sure is becoming a buzzword) , meaning
                    it can operate on data stored external to
                    the EXE in SCROLLER.DBF.

                    SCROLLER() is normally called via a SET KEY.
                    When called, it recieves the parameters
                    PROCNAME and VARIABLE from Clipper, telling
                    it the proc and variable the user was sitting
                    on when he pressed the hotkey. The actual
                    parameters rec'd are PROCNAME,LINE,VARIABLE.
                    Line is ignored, but it is included as the
                    2nd parameter because it is passed.

                    SCROLLER() attemps to find a corresponding
                    record in SCROLLER.DBF (which contains fields
                    for PROCNAME and VARIABLE). SCROLLER.DBF is
                    a storage place for lookup definitions. It
                    contains:

                     SMODULE C   8   Procname from SET KEY
                     SFIELD  C  10   Variable name from SET KEY
                     SDESCR  C  25   Description field used as title
                     SSTRING C 160   Say string - what is displayed
                                     in the lookup box
                     SRETURN C  75   Return string - what is sent to
                                     the keyboard via KEYBOARD
                     SDBFILE C   8   Lookup DBF file name
                     SIND    C   8   Lookup Index file name

                    If SCROLLER does not find a matching record, it
                    simply closes SCROLLER.DBF and returns to the
                    previous area. It then displays a 'lookup table
                    not found' message.

                    If SCROLLER finds a matching record, it loads the
                    values into memory and closes SCROLLER.DBF. It then
                    opens the DBF [and index] of the lookup dbf in
                    the next available area. If it is unable to open
                    the dbf, it displays an error message and goes back
                    to the previously selected area.

                    SCROLLER then draws a box, using the DESCRIPTION
                    field as the title, ititializes a 1 element array
                    composed of the SSTRING expression and calls
                    DBEDIT() with a udf. While in the DBEDIT(), first
                    letter searches can be done if the dbf is indexed
                    with a character index. Pressing ENTER will KEYBOARD
                    the expression in SRETURN (unless its empty), close
                    up the current area and return to the old area.
                    Pressing escape just closes things up and returns to
                    the old area.

                    The KEYBOARD then takes over, feeding the SRETURN
                    expression into the keyboard and into the current
                    GET or GETS.

                    Scroller may ALSO be called directly with the
                    parameters being:

                    1. ""     --+  to account for the
                    2. 0        |- set key parameters
                    3. ""     --+
                    4. [expC1]   lookup box display line
                    5. [expC2]   lookup box value to keyboard
                    6. [expC3]   dbf file to do lookup into
                    7. [expC4]   index file to use with lookup dbf
                    8. [expC5]   description - used as box header

                    If no parameters are passed, the user is prompted
                    for the lookup values.

                    If [expC1] is passed, the current DBF is used
                    for the lookup. If [expC2] is also passed, a
                    value is sent to the keyboard. If [expC3] and
                    optionally [expC4] are passed, a DBF and optionally
                    and index are opened for the lookup. [expC5] if
                    passed is used as a title.


Options
Examples            EXTERNAL SCROLLER
                    SET KEY -1 TO SCROLLER   && F2
                    ..or

                    SCROLLER()     && for user prompting
                    ..or

                    SCROLLER("",0,"","LASTNAME+' '+FIRSTNAME","","CUST")
                    ** would open up CUST.DBF and present a lookup
                    ** table of the expression "LASTNAME+' '+FIRSTNAME"

Examples found in   Well personally I've taken to using SMALLS(), a
                    smaller, streamlined lookup engine.

Notes               See SMALLS() - an alternate to SCROLLER().
                    SCROLLER is the most difficult function in the
                    library. As such, it may find itself replaced
                    by a set of smaller, simpler replacement functions.

Warnings            Be sure to declare SCROLLER EXTERNAL!

Found in (prg)......S_SCROLL.PRG

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson