HB_Alert

HB_Alert

Displays a text-mode dialog box with a message.

Syntax

      HB_Alert( <xMessage>, [<aOptions>], [<cColor>], [<nDelay>] ) --> nChoice

Arguments

<xMessage> : The message to display. May be any data type. Character string may be divided display lines by the semicolon

<aOptions> : An array with available response as character strings. Default is { “Ok” }.

<cColor> : A string as color codes. Default color is “W+/R”.

<nDelay> : Number of seconds to wait to user response before abort. Default value is 0, that wait forever.

Returns

A numeric value indicating the ordinal position within <aOption> selected by the user. Zero value means that user pressed escape key.

If <nDelay> is specified and this number of seconds has elapsed without a key press, the return value is 1.

Description

HB_Alert() displays a dialog box and lets the user select an option. The user can move a highlight bar using arrow keys or the TAB key. To select an option, the user can press ENTER, SPACE or the first letter of an option.

HB_Alert() is extended version of Alert() to support all variables types (not just strings) is passed as first parameter.

Example

      // This example displays a message with two line : file name and 'not found' message.
      // After 15 seconds without user response, assumed 'Abort' selected.

      FUNCTION FNFMessage( cFileName )

         LOCAL cMessage, aOptions, nChoice

         aMessage := { cFileName, 'Not found !' }
         aOptions :=  { 'Abort', 'Retry', 'Skip' }

         nChoice := HB_Alert( aMessage, aOptions, , 15 )

      RETURN nChoice // FNFMessage()

Seealso

@…PROMPT, AChoice(), Alert(), DispBox(), DispOut(), MENU TO

Harbour All Functions – A

AAdd
Abs
AChoice
AClone
ACopy
ACos

ADays
AddASCII
AddMonth
ADel
ADir
AfterAtNum
AEval
AFields
AFill
AIns
Alert
Alias
AllTrim

AMonths
Array
Asc
AScan
ASCIISum
ASCPos
ASin
ASize
ASort
At
AtAdjust
ATail
ATan
ATn2
AtNum
AtRepl
AtToken

C5_Functions

 AADD()          Add a new element to the end of an array
 ABS()           Return the absolute value of a numeric expression
 ACHOICE()       Execute a pop-up menu
 ACLONE()        Duplicate a nested or multidimensional array
 ACOPY()         Copy elements from one array to another
 ADEL()          Delete an array element
 ADIR()*         Fill a series of arrays with directory information
 AEVAL()         Execute a code block for each element in an array
 AFIELDS()*      Fill arrays with the structure of the current database file
 AFILL()         Fill an array with a specified value
 AINS()          Insert a NIL element into an array
 ALERT()         Display a simple modal dialog box
 ALIAS()         Return a specified work area alias
 ALLTRIM()       Remove leading and trailing spaces from a character string
 ALTD()          Invoke the CA-Clipper debugger
 ARRAY()         Create an uninitialized array of specified length
 ASC()           Convert a character to its ASCII value
 ASCAN()         Scan an array for a value or until a block returns true (.T.)
 ASIZE()         Grow or shrink an array
 ASORT()         Sort an array
 AT()            Return the position of a substring within a character string
 ATAIL()         Return the highest numbered element of an array
 BIN2I()         Convert a 16-bit signed integer to a numeric value
 BIN2L()         Convert a 32-bit signed integer to a numeric value
 BIN2W()         Convert a 16-bit unsigned integer to a numeric value
 BOF()           Determine when beginning of file is encountered
 BREAK()         Branch out of a BEGIN SEQUENCE...END construct
 BROWSE()*       Browse records within a window
 CDOW()          Convert a date value to a character day of the week
 CHR()           Convert an ASCII code to a character value
 CMONTH()        Convert a date to a character month name
 COL()           Return the screen cursor column position
 COLORSELECT()   Activate attribute in current color settings
 CTOD()          Convert a date string to a date value
 CURDIR()        Return the current DOS directory
 DATE()          Return the system date as a date value
 DAY()           Return the day of the month as a numeric value
 DBAPPEND()      Append a new record to the database in the current work area
 DBCLEARFIL()    Clear a filter condition
 DBCLEARIND()    Close all indexes for the current work area
 DBCLEARREL()    Clear active relations
 DBCLOSEALL()    Close all occupied work areas
 DBCLOSEAREA()   Close a work area
 DBCOMMIT()      Flush pending updates
 DBCOMMITALL()   Flush pending updates in all work areas
 DBCREATE()      Create a database file from a database structure array
 DBCREATEIND()   Create an index file
 DBDELETE()      Mark a record for deletion
 DBEDIT()        Browse records in a table layout
 DBEVAL()        Evaluate code block for each record matching scope/condition
 DBF()*          Return current alias name
 DBFIELDINFO()   Return and optionally change information about a field
 DBFILEGET()     Insert the contents of a field into a file
 DBFILEPUT()     Insert the contents of a file into a field
 DBFILTER()      Return the current filter expression as a character string
 DBGOBOTTOM()    Move to the last logical record
 DBGOTO()        Position record pointer to a specific identity
 DBGOTOP()       Move to the first logical record
 DBINFO()        Return and optionally change database file information
 DBORDERINFO()   Return and optionally change order and index file information
 DBRECALL()      Reinstate a record marked for deletion
 DBRECORDINFO()  Return and optionally change information about a record
 DBREINDEX()     Recreate all active indexes for the current work area
 DBRELATION()    Return the linking expression of a specified relation
 DBRLOCK()       Lock the record at the current or specified identity
 DBRLOCKLIST()   Return an array of the current lock list
 DBRSELECT()     Return the target work area number of a relation
 DBRUNLOCK()     Release all or specified record locks
 DBSEEK()        Move to the record having the specified key value
 DBSELECTAR()    Change the current work area
 DBSETDRIVER()   Return the database driver and optionally set a new driver
 DBSETFILTER()   Set a filter condition
 DBSETINDEX()    Empty orders from an order bag into the order list
 DBSETORDER()    Set the controlling order
 DBSETRELAT()    Relate two work areas
 DBSKIP()        Move relative to the current record
 DBSTRUCT()      Create an array containing the structure of a database file
 DBUNLOCK()      Release all locks for the current work area
 DBUNLOCKALL()   Release all locks for all work areas
 DBUSEAREA()     Use a database file in a work area
 DELETED()       Return the deleted status of the current record
 DESCEND()       Create a descending index key value
 DEVOUT()        Write a value to the current device
 DEVOUTPICT()    Write a value to the current device using a picture clause
 DEVPOS()        Move the cursor or printhead to a new position
 DIRCHANGE()     Change the current DOS directory
 DIRECTORY()     Create an array of directory and file information
 DIRMAKE()       Create a directory
 DIRREMOVE()     Remove a directory
 DISKCHANGE()    Change the current DOS disk drive
 DISKNAME()      Return the current DOS drive
 DISKSPACE()     Return the space available on a specified disk
 DISPBEGIN()     Begin buffering screen output
 DISPBOX()       Display a box on the screen
 DISPCOUNT()     Return the number of pending DISPEND() requests
 DISPEND()       Display buffered screen updates
 DISPOUT()       Write a value to the display
 DOSERROR()      Return the last DOS error number
 DOW()           Convert a date value to a numeric day of the week
 DTOC()          Convert a date value to a character string
 DTOS()          Convert a date value to a string formatted as yyyymmdd
 EMPTY()         Determine if the result of an expression is empty
 EOF()           Determine when end of file is encountered
 ERRORBLOCK()    Post a code block to execute when a runtime error occurs
 ERRORLEVEL()    Set the CA-Clipper return code
 EVAL()          Evaluate a code block
 EXP()           Calculate e**x
 FCLOSE()        Close an open binary file and write DOS buffers to disk
 FCOUNT()        Return the number of fields in the current .dbf file
 FCREATE()       Create and/or truncate a binary file to zero-length
 FERASE()        Delete a file from disk
 FERROR()        Test for errors after a binary file operation
 FIELD()         Return a field name from the current database (.dbf) file
 FIELDBLOCK()    Return a set-get code block for a given field
 FIELDGET()      Retrieve the value of a field using the field position
 FIELDNAME()     Return a field name from the current database (.dbf) file
 FIELDPOS()      Return the position of a field in a work area
 FIELDPUT()      Set the value of a field variable using the field position
 FIELDWBLOCK()   Return a set-get code block for a field in a given work area
 FILE()          Determine if files exist in the default directory or path
 FKLABEL()*      Return function key name
 FKMAX()*        Return number of function keys as a constant
 FLOCK()         Lock an open and shared database file
 FOPEN()         Open a binary file
 FOUND()         Determine if the previous search operation succeeded
 FREAD()         Read characters from a binary file into a buffer variable
 FREADSTR()      Read characters from a binary file
 FRENAME()       Change the name of a file
 FSEEK()         Set a binary file pointer to a new position
 FWRITE()        Write to an open binary file
 GETACTIVE()     Return the currently active Get object
 GETAPPLYKEY()   Apply a key to a Get object from within a reader
 GETDOSETKEY()   Process SET KEY during GET editing
 GETENV()        Retrieve the contents of a DOS environment variable
 GETPOSTVALID()  Postvalidate the current Get object
 GETPREVALID()   Prevalidate a Get object
 GETREADER()     Execute standard READ behavior for a Get object
 HARDCR()        Replace all soft carriage returns with hard carriage returns
 HEADER()        Return the current database file header length
 I2BIN()         Convert a CA-Clipper numeric to a 16-bit binary integer
 IF()            Return the result of an expression based on a condition
 IIF()           Return the result of an expression based on a condition
 INDEXEXT()      Return index extension defined by the current database driver
 INDEXKEY()      Return the key expression of a specified index
 INDEXORD()      Return the order position of the controlling index
 INKEY()         Extract a character from the keyboard buffer or a mouse event
 INT()           Convert a numeric value to an integer
 ISALPHA()       Determine if the leftmost character in a string is alphabetic
 ISCOLOR()       Determine if the current computer has color capability
 ISDIGIT()       Determine if the leftmost character in a string is a digit
 ISLOWER()       Determine if the leftmost character is a lowercase letter
 ISPRINTER()     Determine whether LPT1 is ready
 ISUPPER()       Determine if the leftmost character in a string is uppercase
 L2BIN()         Convert a CA-Clipper numeric value to a 32-bit binary integer
 LASTKEY()       Return INKEY() value of last key extracted from the keyboard
 LASTREC()       Determine the number of records in the current .dbf file
 LEFT()          Extract substring beginning with first character in a string
 LEN()           Return the length of a string or number of array elements
 LOG()           Calculate the natural logarithm of a numeric value
 LOWER()         Convert uppercase characters to lowercase
 LTRIM()         Remove leading spaces from a character string
 LUPDATE()       Return the last modification date of a database (.dbf) file
 MAX()           Return the larger of two numeric or date values
 MAXCOL()        Determine the maximum visible screen column
 MAXROW()        Determine the maximum visible screen row
 MEMOEDIT()      Display or edit character strings and memo fields
 MEMOLINE()      Extract a line of text from a character string or memo field
 MEMOREAD()      Return the contents of a disk file as a character string
 MEMORY()        Determine the amount of available free pool memory
 MEMOSETSUPER()  Set an RDD inheritance chain for the DBFMEMO database driver
 MEMOTRAN()      Replace carriage return/linefeeds in character strings
 MEMOWRIT()      Write a character string or memo field to a disk file
 MEMVARBLOCK()   Return a set-get code block for a given memory variable
 MENUMODAL()     Activate a top bar menu
 MIN()           Return the smaller of two numeric or date values
 MLCOUNT()       Count the number of lines in a character string or memo field
 MLCTOPOS()      Return position of a string based on line and column position
 MLPOS()         Determine the position of a line in a string or memo field 
 MOD()*          Return the dBASE III PLUS modulus of two numbers
 MONTH()         Convert a date value to the number of the month
 MPOSTOLC()      Return line/ column position of a string based on a position
 NETERR()        Determine if a network command has failed
 NETNAME()       Return the current workstation identification
 NEXTKEY()       Read the pending key in the keyboard buffer 
 NOSNOW()        Toggle snow suppression
 ORDBAGEXT()     Return the default order bag RDD extension
 ORDBAGNAME()    Return the order bag name of a specific order
 ORDCOND()       Specify conditions for ordering
 ORDCONDSET()    Set the condition and scope for an order
 ORDCREATE()     Create an order in an order bag
 ORDDESCEND()    Return and optionally change the descending flag of an order
 ORDDESTROY()    Remove a specified order from an order bag
 ORDFOR()        Return the FOR expression of an order
 ORDISUNIQUE()   Return the status of the unique flag for a given order
 ORDKEY()        Return the key expression of an order
 ORDKEYADD()     Add a key to a custom built order
 ORDKEYCOUNT()   Return the number of keys in an order
 ORDKEYDEL()     Delete a key from a custom built order
 ORDKEYGOTO()    Move to a record specified by its logical record number
 ORDKEYNO()      Get the logical record number of the current record
 ORDKEYVAL()     Get key value of the current record from controlling order
 ORDLISTADD()    Add orders to the order list
 ORDLISTCLEAR()  Clear the current order list
 ORDLISTREBUI()  Rebuild all orders in the order list of the current work area
 ORDNAME()       Return the name of an order in the order list
 ORDNUMBER()     Return the position of an order in the current order list
 ORDSCOPE()      Set or clear the boundaries for scoping key values
 ORDSETFOCUS()   Set focus to an order in an order list
 ORDSETRELAT()   Relate a specified work area to the current work area
 ORDSKIPUNIQUE() Move record pointer to the next or previous unique key
 OS()            Return the operating system name
 OUTERR()        Write a list of values to the standard error device
 OUTSTD()        Write a list of values to the standard output device
 PAD()           Pad character, date, and numeric values with a fill character
 PCOL()          Return the current column position of the printhead
 PCOUNT()        Determine the position of the last actual parameter passed
 PROCLINE()      Return source line number of current or previous activation
 PROCNAME()      Return name of the current or previous procedure or function
 PROW()          Return the current row position of the printhead
 QOUT()          Display a list of expressions to the console
 RAT()           Return the position of the last occurrence of a substring
 RDDLIST()       Return an array of the RDDs
 RDDNAME()       Return name of RDD active in current or specified work area
 RDDSETDEFAULT() Set or return the default RDD for the application
 READEXIT()      Toggle Up arrow and Down arrow as READ exit keys
 READFORMAT()    Return and optionally set code block to implement format file
 READINSERT()    Toggle the current insert mode for READ and MEMOEDIT()
 READKEY()*      Determine what key terminated a READ
 READKILL()      Return and optionally set whether current READ can be exited
 READMODAL()     Activate a full-screen editing mode for a GetList
 READUPDATED()   Determine whether any GET variables changed during a READ
 READVAR()       Return the current GET/MENU variable name
 RECCOUNT()*     Determine the number of records in the current database file
 RECNO()         Return the identity at the position of the record pointer
 RECSIZE()       Determine the record length of a database (.dbf) file
 REPLICATE()     Return a string repeated a specified number of times
 RESTSCREEN()    Display a saved screen region to a specified location
 RIGHT()         Return a substring beginning with the rightmost character
 RLOCK()         Lock the current record in the active work area
 ROUND()         Return a numeric value rounded to a specified number of digits
 ROW()           Return the screen row position of the cursor
 RTRIM()         Remove trailing spaces from a character string
 SAVESCREEN()    Save a screen region for later display
 SCROLL()        Scroll a screen region up or down, right or left
 SECONDS()       Return the number of seconds elapsed since midnight
 SELECT()        Determine the work area number of a specified alias
 SET()           Inspect or change a system setting
 SETBLINK()      Toggle * interpretation between blinking/background intensity
 SETCANCEL()     Toggle Alt+C and Ctrl+Break as program termination keys
 SETCOLOR()      Return the current colors and optionally set new colors
 SETCURSOR()     Set the cursor shape
 SETKEY()        Assign an action block to a key
 SETMODE()       Change display mode to a specified number of rows and columns
 SETPOS()        Move the cursor to a new position
 SETPRC()        Set PROW() and PCOL() values
 SOUNDEX()       Convert a character string to "soundex" form
 SPACE()         Return a string of spaces
 SQRT()          Return the square root of a positive number
 STR()           Convert a numeric expression to a character string
 STRTRAN()       Search and replace characters within a string or memo field
 STUFF()         Delete and insert characters in a string
 SUBSTR()        Extract a substring from a character string
 TIME()          Return the system time
 TONE()          Sound a speaker tone for a specified frequency and duration
 TRANSFORM()     Convert any value into a formatted character string
 TRIM()          Remove trailing spaces from a character string
 TYPE()          Determine the type of an expression
 UPDATED()       Determine whether a GET changed during a READ
 UPPER()         Convert lowercase characters to uppercase
 USED()          Determine whether a database file is in USE
 VAL()           Convert a character number to numeric type
 VALTYPE()       Determine the data type returned by an expression
 VERSION()       Returns CA-Clipper version
 WORD()*         Convert CALL command numeric parameters from double to int
 YEAR()          Convert a date value to the year as a numeric value

C5_ALERT

 ALERT()
 Display a simple modal dialog box
------------------------------------------------------------------------------
 Syntax

     ALERT( <cMessage>, [<aOptions>] ) --> nChoice

 Arguments

     <cMessage> is the message text displayed and centered in the alert
     box.  If the message contains one or more semicolons, the text after the
     semicolons is centered on succeeding lines in the dialog box.

     <aOptions> defines a list of up to 4 possible responses to the
     dialog box.

 Returns

     ALERT() returns a numeric value indicating which option was chosen.  If
     the Esc key is pressed, the value returned is zero.

 Description

     The ALERT() function creates a simple modal dialog.  It is useful in
     error handlers and other "pause" functions.  The user can respond by
     moving a highlight bar and pressing the Return or SpaceBar keys, or by
     pressing the key corresponding to the first letter of the option.  If
     <aOptions> is not supplied, a single "Ok" option is presented.

     ALERT() is sensitive to the presence or absence of the Clipper
     full-screen I/O system.  If the full-screen system is not present,
     ALERT() uses standard I/O to display the message and options tty-style
     (i.e., 80-column, without word wrap, each line ended with carriage
     return/linefeed).

 Examples

     .  This example demonstrates use of an alert dialog box.  First,
        the array of options is defined, the ALERT() function gets the user's
        selection, and finally, the user's choice is handled with a DO
        CASE...ENDCASE control structure:

        #define AL_SAVE         1
        #define AL_CANCEL      2
        #define AL_CONT         3

        // Define an array of options
        aOptions := {"Save", "Don't Save", "Continue"}

        // Display the dialog box and get the user's selection
        nChoice  := ALERT("File has changed...", aOptions)

        // Handle the user's request
        DO CASE
        CASE nChoice == AL_SAVE
           ? "Save"
        CASE nChoice == AL_CANCEL
           ? "Don't Save"
        CASE nChoice == AL_CONT
           ? "Continue"
        OTHERWISE
           ? "Escape"
        ENDCASE
        //
        RETURN

 Files   Library is LLIBG.LIB.

See Also: @…PROMPT MENU TO

 

Design of Clipper

build the truly reusable routine

C5 UI Commands & Functions

C5 User Interface Commands and Functions

Global Settings :

SET CENTURY :

Modify the date format to include or omit century digits

SET CENTURY on | OFF | <xlToggle>

SET COLOR* :

Define screen colors

SET COLOR | COLOUR TO [[<standard>]
    [,<enhanced>] [,<border>] [,<background>]
    [,<unselected>]] | (<cColorString>)

SET CONFIRM :

Toggle required exit key to terminate GETs

SET CONFIRM on | OFF | <xlToggle>

SET CONSOLE :

Toggle console display to the screen

SET CONSOLE ON | off | <xlToggle>

SET CURSOR :

Toggle the screen cursor on or off

SET CURSOR ON | off | <xlToggle>

SET DATE :

Set the date format for input and display

SET DATE FORMAT [TO] <cDateFormat>
SET DATE [TO] AMERICAN | ansi | british | french
    | german | italian | japan | usa

SET DECIMALS :

Set the number of decimal places displayed

SET DECIMALS TO [<nDecimals>]

SET DELIMITERS :

Toggle or define GET delimiters

SET DELIMITERS on | OFF | <xlToggle>
SET DELIMITERS TO [<cDelimiters> | DEFAULT]

SET DEVICE :

Direct @…SAYs to the screen or printer

SET DEVICE TO SCREEN | printer

SET EPOCH :

Control the interpretation of dates with no century digits

SET EPOCH TO <nYear>

SET FIXED :

Toggle fixing of the number of decimal digits displayed

SET FIXED on | OFF | <xlToggle>

SETBLINK() :

Toggle asterisk (*) interpretation in SET COLOR

SETBLINK([<lToggle>]) --> lCurrentSetting

SETCOLOR() :

Return the current colors and optionally set new colors

SETCOLOR([<cColorString>]) --> cColorString

SETCURSOR() :

Set the cursor shape

SETCURSOR([<nCursorShape>]) --> nCurrentSetting

SETMODE() :

Change display mode to specified number of rows and columns

SETMODE(<nRows>, <nCols>) --> lSuccess

SETPOS() :

Move the cursor to a new position

SETPOS(<nRow>, <nCol>) --> NIL

User Input :

CLEAR TYPEAHEAD :

Empty the keyboard buffer

CLEAR TYPEAHEAD

INKEY() :

Extract a character from the keyboard buffer

 
INKEY( [ <nSeconds> ] ) --> nInkeyCode

KEYBOARD :

Stuff a string into the keyboard buffer

KEYBOARD <cString>

LASTKEY() :

Return the INKEY() value of the last key in the buffer

LASTKEY() --> nInkeyCode

NEXTKEY() :

Read the pending key in the keyboard buffer

NEXTKEY() --> nInkeyCode

SET TYPEAHEAD :

Set the size of the keyboard buffer

SET TYPEAHEAD TO <nKeyboardSize>

Basic :

?/?? :

Display one or more values to the console

? | ?? [<exp list>]

@…BOX :

Draw a box on the screen

@ <nTop>, <nLeft>, <nBottom>, <nRight>
  BOX <cBoxString> [COLOR <cColorString>]

@…CLEAR :

Clear a rectangular region of the screen

@ <nTop>, <nLeft> [CLEAR
  [TO <nBottom>, <nRight>]]

@…SAY :

Display data at a specified screen or printer row and column

@ <nRow>, <nCol>
    [SAY <exp>
    [PICTURE <cSayPicture>]
    [COLOR <cColorString>]]
    GET <idVar>
    [PICTURE <cGetPicture>]
    [COLOR <cColorString>]
    [WHEN <lPreExpression>]
    [RANGE* <dnLower>, <dnUpper>] |
    [VALID <lPostExpression>]

@…TO :

Draw a single or double line box

@ <nTop>, <nLeft>
    TO <nBottom>, <nRight> [DOUBLE] [COLOR
    <cColorString>]

ACCEPT :

Place keyboard input into a memory variable

ACCEPT [<expPrompt>] TO <idVar>

INPUT :

Enter the result of an expression into a variable

INPUT [<expPrompt>] TO <idVar>

 

ALERT() :

Display a simple modal dialog box

ALERT( <cMessage>, [<aOptions>] ) --> nChoice

CLEAR SCREEN :

Clear the screen and home the cursor

CLEAR [SCREEN] | CLS

COL() :

Return the screen cursor column position

COL() --> nCol

COLORSELECT()

                Activate attribute in current color settings

   COLORSELECT(<nColorIndex>) --> NIL

DEVOUT() :

Write a value to the current device

DEVOUT(<exp>, [<cColorString>]) --> NIL

DEVOUTPICT() :

Write a value to the current device using a picture clause

DEVOUTPICT(<exp>, <cPicture>, [<cColorString>]) --> NIL

           DEVPOS() :

Move the cursor or printhead to a new position depending on the

current device

        DEVPOS(<nRow>, <nCol>) --> NIL

DISPBEGIN() :

Begin buffering screen output

DISPBEGIN() --> NIL

DISPBOX() :

Display a box on the screen

DISPBOX(<nTop>, <nLeft>, <nBottom>, <nRight>,
    [<cnBoxString>], [<cColorString>]) --> NIL

DISPCOUNT() :

Return the number of pending DISPEND() requests

DISPCOUNT() --> nDispCount

DISPEND() :

Display buffered screen updates

DISPEND() --> NIL

DISPOUT() :

Write a value to the display

DISPOUT(<exp>, [<cColorString>]) --> NIL

OUTERR() :

Write a list of values to the standard error device

OUTERR(<exp list>) --> NIL

OUTSTD() :

Write a list of values to the standard output device

OUTSTD(<exp list>) --> NIL

QOUT() :

Display a list of expressions to the console

QOUT([<exp list>]) --> NIL
QQOUT([<exp list>]) --> NIL

RESTORE SCREEN* :

Display a saved screen

RESTORE SCREEN [FROM <cScreen>]

RESTSCREEN() :

Display a saved screen region to a specified location

RESTSCREEN([<nTop>], [<nLeft>],
    [<nBottom>], [<nRight>], <cScreen>) --> NIL

ROW() :

Return the screen row position of the cursor

ROW() --> nRow

SAVE SCREEN* :

Save current screen to a buffer or variable

SAVE SCREEN [TO <idVar>]

SAVESCREEN() :

Save a screen region for later display

SAVESCREEN([<nTop>], [<nLeft>],
    [<nBottom>], [<nRight>]) --> cScreen

SCROLL() :

Scroll a screen region up or down

SCROLL([<nTop>], [<nLeft>],
     [<nBottom>], [<nRight>], [<nVert>] [<nHoriz>])
 --> NIL

TYPE :

Display or print the contents of a text file

TYPE <xcFile> [TO PRINTER] [TO FILE <xcOutFile>]

Advanced :

ACHOICE() :

Execute a pop-up menu

ACHOICE(<nTop>, <nLeft>, <nBottom>, <nRight>,
    <acMenuItems>,
    [<alSelectableItems> | <lSelectableItems>],
    [<cUserFunction>],
    [<nInitialItem>],
    [<nWindowRow>]) --> nPosition

BROWSE()* :

Browse records within a window

BROWSE([<nTop>], [<nLeft>],
    [<nBottom>], [<nRight>]) --> lSuccess

DBEDIT() :

Browse records in a table format

DBEDIT( [<nTop>], [<nLeft>],
    [<nBottom>], <nRight>],
    [<acColumns>],
    [<cUserFunction>],
    [<acColumnSayPictures> | <cColumnSayPicture>],
    [<acColumnHeaders> | <cColumnHeader>],
    [<acHeadingSeparators> | <cHeadingSeparator>],
    [<acColumnSeparators> | <cColumnSeparator>],
    [<acFootingSeparators> | <cFootingSeparator>],
    [<acColumnFootings> | <cColumnFooting>]) --> NIL

DISPLAY :

Display records to the console

DISPLAY <exp list>
    [TO PRINTER] [TO FILE <xcFile>]
    [<scope>] [WHILE <lCondition>]
    [FOR <lCondition>] [OFF]

LIST :

List records to the console

LIST <exp list>
    [TO PRINTER] [TO FILE <xcFile>]
    [<scope>] [WHILE <lCondition>]
    [FOR <lCondition>] [OFF]

LABEL FORM :

Display labels to the console

LABEL FORM <xcLabel>
    [TO PRINTER] [TO FILE <xcFile>] [NOCONSOLE]
    [<scope>] [WHILE <lCondition>] [FOR <lCondition>]
    [SAMPLE]

REPORT FORM :

Display a report to the console

REPORT FORM <xcReport>
    [TO PRINTER] [TO FILE <xcFile>] [NOCONSOLE]
    [<scope>] [WHILE <lCondition>] [FOR <lCondition>]
    [PLAIN | HEADING <cHeading>] [NOEJECT] [SUMMARY]

TEXT :

Display a literal block of text

TEXT [TO PRINTER] [TO FILE <xcFile>]
    <text>...
ENDTEXT

GET System :

Standard :

@…GET :

Create a new Get object and display it on the screen

@ <nRow>, <nCol>
    [SAY <exp>
    [PICTURE <cSayPicture>]
    [COLOR <cColorString>]]
    GET <idVar>
    [PICTURE <cGetPicture>]
    [COLOR <cColorString>]
    [WHEN <lPreExpression>]
    [RANGE* <dnLower>, <dnUpper>] |
    [VALID <lPostExpression>]

CLEAR GETS :

Release Get objects from the current GetList array

CLEAR GETS

READ :

Activate full-screen editing mode using Get objects

READ [SAVE]

READEXIT() :

Toggle Uparrow and Downarrow as READ exit keys

READEXIT([<lToggle>]) --> lCurrentState

READINSERT() :

Toggle the current insert mode for READ and MEMOEDIT()

READINSERT([<lToggle>]) --> lCurrentMode

READKEY()* :

Determine what key was used to terminate a READ

READKEY() --> nReadkeyCode

READMODAL() :

Activate a full-screen editing mode for a GetList

READMODAL(<aGetList>) --> NIL

READVAR() :

Return the current GET/MENU variable name

READVAR() --> cVarName

SET ESCAPE :

Toggle Esc as a READ exit key

SET ESCAPE ON | off | <xlToggle>

SET FORMAT :

Activate a format when READ is executed

SET FORMAT TO [<idProcedure>[.<ext>]]

SET INTENSITY :

Toggle enhanced display of GETs and PROMPTs

SET INTENSITY ON | off | <xlToggle>

SET SCOREBOARD :

Toggle the message display from READ or MEMOEDIT()

SET SCOREBOARD ON | off | <xlToggle>

UPDATED() :

Determine if any GET changed during a READ

UPDATED() --> lChange

Getsys.prg Functions :

GETACTIVE() :

Return the currently active Get object

GETACTIVE() --> objGet

GETAPPLYKEY() :

Apply a key to a Get object from within a Get reader

GETAPPLYKEY(<oGet>, <nKey>) --> NIL

GETDOSETKEY() :

Process SET KEY during Get editing

GETDOSETKEY(<oGet>) --> NIL

GETPOSTVALIDATE() :

Postvalidate the current Get object

GETPOSTVALIDATE(<oGet>) --> lSuccess

GETPREVALIDATE() :

Prevalidate a Get object

GETPREVALIDATE(<oGet>) --> lSuccess

GETREADER() :

Execute standard READ behavior for a Get object

GETREADER(<oGet>) --> NIL

READFORMAT() :

Return, and optionally set, the format file code block

READFORMAT([<bFormat>]) --> bCurrentFormat

READKILL() :

Return, and optionally set, the READ terminate flag

READKILL([<lKillRead>]) --> lCurrentSetting

READUPDATED() :

Return, and optionally set, whether a Get changed

READUPDATED([<lChanged>]) --> lCurrentSetting

GET Class :

Class Function :

GetNew() : Create a new Get object

Exported Instance Variables :

badDate : Indicates if the editing buffer contains an invalid date
block : Code block to associate Get with a variable
buffer : Character value that defines the editing buffer
cargo : User-definable variable
changed : Indicates whether the Get:buffer has changed
clear : Indicates whether the editing buffer should be cleared
col : Get column number
colorSpec : Display attributes string
decPos : Decimal point position within the editing buffer
exitState : Means by which the user exited the Get
hasFocus : Indicates whether or not the Get object has input focus
minus : Indicates whether or not a minus sign has been entered
name : Get variable name
original : Character string containing the original value of the Get
picture : PICTURE string
pos : Current cursor position within the editing buffer
postBlock : Code block to validate a newly entered value
preBlock : Code block to decide if editing is permitted
reader : Contains a block to affect READ behavior on a Get object
rejected : Indicates if last insert/overStrike character was rejected
row : Get row number
subscript : Information about array Get objects .
type : Get variable data type
typeOut : Indicates attempt to move the cursor out of editing buffer

Exported Methods :

State Change Methods :

assign() : Assigns the editing buffer contents to the Get variable
colorDisp() : Changes a Get object’s color and then redisplay it
display() : Displays the Get on the screen .
killFocus() : Takes input focus away from the Get object
reset() : Resets the internal state information of the Get
setFocus() : Gives input focus to the Get object
undo() : Sets the Get variable back to Get:original
unTransform() : Converts character value to its original data type
updateBuffer() : Updates the editing buffer and redisplays the Get
varGet() : Returns the current value of the Get variable
varPut() : Sets the Get variable to the passed value

Cursor Movement Methods :

end() : Moves the cursor to the rightmost position
home() : Moves the cursor to the leftmost position
left() : Moves the cursor left one character
right() : Moves the cursor right one character
toDecPos() : Moves the cursor to the immediate right of Get:decPos
wordLeft() : Moves the cursor left one word
wordRight() : Moves the cursor right one word

Editing Methods :

backspace() : Moves the cursor to the left and deletes one character
delete() : Deletes the character under the cursor
delEnd() : Deletes from current cursor position to the end of the Get
delLeft() : Deletes the character to the left of the cursor
delRight() : Deletes the character to the right of the cursor
delWordLeft() : Deletes the word to the left of the cursor
delWordRight() : Deletes the word to the right of the cursor

Text Entry Methods :

insert() : Inserts characters into the editing buffer
overStrike() : Overwrites characters in the editing buffer

Menu System :

@…PROMPT :

Paint a menu item and define a message

@ <nRow>, <nCol> PROMPT <cMenuItem>
     [MESSAGE <cExpression>]

MENU TO :

Execute a lightbar menu for defined PROMPTs

     MENU TO <idVar>

          MENUMODAL :

Activate a top bar menu

         MENUMODAL(<oTopBar>, <nSelection>, <nMsgRow>,
             <nMsgLeft>, <nMsgRight>, <cMsgColor>) --> MenuID

SET MESSAGE :

Set the @…PROMPT message line row

SET MESSAGE TO [<nRow> [CENTER | CENTRE]]

SET INTENSITY :

Toggle enhanced display of GETs and PROMPTs

SET INTENSITY ON | off | <xlToggle>

SET WRAP :

Toggle wrapping of the highlights in MENUs

SET WRAP on | OFF | <xlToggle>

Browse Classes :

TBrowse :

Provides objects for browsing table-oriented data.

Description :

A TBrowse object is a general purpose browsing mechanism for table-oriented data. TBrowse objects provide a sophisticated architecture for acquiring, formatting, and displaying data. Data retrieval and file positioning are performed via user-supplied code blocks, allowing a high degree of flexibility and interaction between the browsing mechanism and the underlying data source. The format of individual data items can be precisely controlled via the TBColumn data retrieval code blocks; overall display formatting and attributes can be controlled by sending appropriate messages to the TBrowse object.

A TBrowse object relies on one or more TBColumn objects. A TBColumn object contains the information necessary to define a single column of the browse table (see TBColumn class in this chapter).

During operation, a TBrowse object retrieves data by evaluating code blocks. The data is organized into rows and columns and displayed within a specified rectangular region of the screen. The TBrowse object maintains an internal browse cursor. The data item on which the browse cursor rests is displayed in a highlighted color. (The actual screen cursor is also positioned to the first character of this data item.)

Initially, the browse cursor is placed on the data item at the top left of the browse display. Messages can then be sent to the TBrowse object to navigate the displayed data, causing the browse cursor to move. These messages are normally sent in response to user keystrokes.

New data is automatically retrieved as required by navigation requests. When navigation proceeds past the edge of the visible rectangle, rows or columns beyond that edge are automatically brought into view. When new rows are brought into view, the underlying data source is repositioned by evaluating a code block.

Note: TBrowse objects do not clear the entire window before output during redisplay operations. Part of the window may still be cleared when data from the existing display is scrolled.

Class Functions :

TBrowseNew() :

Create a new TBrowse object

 TBrowseNew(<nTop>, <nLeft>, <nBottom>, <nRight>)
 --> objTBrowse

Returns a new TBrowse object with the specified coordinate settings. The TBrowse object is created with no columns and no code blocks for data positioning. These must be provided before the TBrowse object can be used.

TBrowseDB() :

Create a new TBrowse object for browsing a database file

 TBrowseDB(<nTop>, <nLeft>, <nBottom>, <nRight>)
 --> objTBrowse

Returns a new TBrowse object with the specified coordinate settings and default code blocks for data source positioning within database files. The default code blocks execute the GO TOP, GO BOTTOM, and SKIP operations.

Note that TBrowseDB() creates an object with no column objects. To make the TBrowse object usable, you must add a column for each field to be displayed

Exported Instance Variables:

autoLite : Logical value to control highlighting
cargo : User-definable variable
colCount : Number of browse columns
colorSpec : Color table for the TBrowse display
colPos : Current cursor column position
colSep : Column separator character
footSep : Footing separator character
freeze : Number of columns to freeze
goBottomBlock : Code block executed by TBrowse:goBottom()
goTopBlock : Code block executed by TBrowse:goTop()
headSep : Heading separator character
hitBottom : Indicates the end of available data
hitTop : Indicates the beginning of available data
leftVisible : Indicates position of leftmost unfrozen column in display
nBottom : Bottom row number for the TBrowse display
nLeft : Leftmost column for the TBrowse display
nRight : Rightmost column for the TBrowse display
nTop : Top row number for the TBrowse display
rightVisible : Indicates position of rightmost unfrozen column in display
rowCount : Number of visible data rows in the TBrowse display
rowPos : Current cursor row position
skipBlock : Code block used to reposition data source
stable : Indicates if the TBrowse object is stable

Exported Methods:

Cursor Movement Methods :

down() : Moves the cursor down one row
end() : Moves the cursor to the rightmost visible data column
goBottom() : Repositions the data source to the bottom of file
goTop() : Repositions the data source to the top of file
home() : Moves the cursor to the leftmost visible data column
left() : Moves the cursor left one column
pageDown() : Repositions the data source downward
pageUp() : Repositions the data source upward
panEnd() : Moves the cursor to the rightmost data column
panHome() : Moves the cursor to the leftmost visible data column
panLeft() : Pans left without changing the cursor position
panRight() : Pans right without changing the cursor position
right() : Moves the cursor right one column
up() : Moves the cursor up one row

Miscellaneous Methods :

addColumn() : Adds a TBColumn object to the TBrowse object
colorRect() : Alters the color of a rectangular group of cells
colWidth() : Returns the display width of a particular column
configure() : Reconfigures the internal settings of the TBrowse object
deHilite() : Dehighlights the current cell
delColumn() : Delete a column object from a browse
forceStable() : Performs a full stabilization .
getColumn() : Gets a specific TBColumn object
hilite() : Highlights the current cell
insColumn() : Insert a column object in a browse
invalidate() : Forces redraw during next stabilization
refreshAll() : Causes all data to be refreshed during the next stabilize
refreshCurrent() : Causes the current row to be refreshed on next stabilize
setColumn() : Replaces one TBColumn object with another
stabilize() : Performs incremental stabilization

TBColumn :

Provides the column objects TBrowse objects.

Description :

A TBColumn object is a simple object containing the information needed to fully define one data column of a TBrowse object (see the TBrowse reference in this chapter). TBColumn objects have no methods, only exported instance variables.

Class Function :

TBColumnNew() :

Create a new TBColumn object.

TBColumnNew(<cHeading>, <bBlock>) --> objTBColumn

Exported Instance Variables :

block : Code block to retrieve data for the column
cargo : User-definable variable
colorBlock : Code block that determines color of data items
colSep : Column separator character
defColor : Array of numeric indexes into the color table
footing : Column footing
footSep : Footing separator character
heading : Column heading
headSep : Heading separator character
width : Column display width

Example :

This example is a code fragment that creates a TBrowse object and adds some TBColumn objects to it:

USE Customer NEW
//
// Create a new TBrowse object
objBrowse := TBrowseDB(1, 1, 23, 79)
//
// Create some new TBColumn objects and
// add them to the TBrowse object
objBrowse:addColumn(TBColumnNew( "Customer", ;
                    {|| Customer->Name} ))
objBrowse:addColumn(TBColumnNew( "Address", ;
                    {|| Customer->Address} ))
objBrowse:addColumn(TBColumnNew( "City", ;
                    {|| Customer->City} ))
.
. <statements to actually browse the data>
.
CLOSE Customer

For a simple and working sample look at here.