SET ESCAPE

SET ESCAPE

Toggle Esc as a READ exit key

Syntax

      SET ESCAPE ON | off | <xlToggle>

Arguments

ON enables Esc as a READ exit key.

OFF disables Esc as a READ exit key.

<xlToggle> is a logical expression that must be enclosed in parentheses. A value of true (.T.) is the same as ON, and a value of false (.F.) is the same as OFF.

Description

If SET ESCAPE is ON, Esc terminates the current READ. Any changes made to the current Get object are lost, and validation with RANGE or VALID is bypassed. When SET ESCAPE is OFF and the user presses Esc, the key press is ignored. With SET KEY, however, you can reassign Esc for special handling, regardless of the status of SET ESCAPE.

Seealso

READ, READEXIT(), SETCANCEL(), SET KEY, SETKEY()

SET DESCENDING

SET DESCENDING

Change the descending flag of the controlling order

Syntax

      SET DESCENDING ON | OFF | (<lToggle>)

Arguments

ON enables the descending flag.

OFF disables the descending flag.

<lToggle> is a logical expression that must be enclosed in parentheses. A value of true (.T.) is the same as ON, and a value of false (.F.) is the same as OFF.

Note

The initial default of this setting depends on whether the controlling order was created with DESCENDING as an attribute.

Description

SET DESCENDING is functionally equivalent to ORDDESCEND(). Refer to this function for more information.

Examples

      .  The following example illustrates SET DESCENDING.  every order
        can be both ascending and descending:

      USE Customer VIA "DBFCDX"
      INDEX ON LastName TAG Last
      INDEX ON FirstName TAG First DESCENDING

      SET ORDER TO TAG Last
      // last was originally created in ascending order

      // Swap it to descending
      SET DESCENDING ON
      // Last will now be processed in descending order

      SET ORDER TO TAG First
      // First was originally created in descending order

      // Swap it to ascending
      SET DESCENDING OFF
      // First will now be processed in ascending order

Sealso

ORDDESCEND()

SET DELIMITERS

SET DELIMITERS

Toggle or define GET delimiters

Syntax

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

Arguments

ON displays delimiters for GET variables.

OFF suppresses the delimiter display.

<xlToggle> is a logical expression that must be enclosed in parentheses. A value of true (.T.) is the same as ON, and a value of false (.F.) is the same as OFF.

TO <cDelimiters> defines a one or two character delimiter. Specifying a single character uses the same character as both the beginning and ending delimiter. Specifying two characters uses the first as the beginning delimiter and the second as the ending delimiter.

TO DEFAULT or no delimiters SETs the delimiters to colons which are the default delimiters.

Description

SET DELIMITERS is a dual purpose command that both defines characters used to delimit GETs and toggles the automatic display of delimiters ON or OFF. The @…GET command can display delimiters that surround a Get object’s display. If DELIMITERS is ON, the delimiters add two characters to the length of the Get object display.

You can configure the delimiter characters using the TO <cDelimiters> clause. The DEFAULT delimiter character is the colon (:). When specifying delimiters, the beginning and ending delimiter characters can be different. If you wish to suppress either the right, left, or both delimiters, use a space instead of the delimiter character.

Typically, delimiters are unnecessary since GETs display in reverse video or enhanced color if INTENSITY is ON.

Examples

      .  This example SETs DELIMITERS TO a colon and a space for the
         first GET and the square bracket characters for the second:

      LOCAL cVar := SPACE(5), cVar2 := SPACE(5)
      SET DELIMITERS ON

      SET DELIMITERS TO ": "
      @ 1, 0 SAY "Enter" GET cVar
      SET DELIMITERS TO "[]"
      @ 2, 0 SAY "Enter" GET cVar2
      READ

Seealso

@…GET, SET INTENSITY

SET DELETED

SET DELETED

Toggle filtering of deleted records

Syntax

      SET DELETED on | OFF | <xlToggle>

Arguments

ON ignores deleted records.

OFF processes deleted records.

<xlToggle> is a logical expression that must be enclosed in parentheses. A value of true (.T.) is the same as ON, and a value of false (.F.) is the same as OFF.

Description

SET DELETED toggles automatic filtering of records marked for deletion in all work areas. When SET DELETED is ON, most commands ignore deleted records. If, however, you refer to a record by record number (GOTO or any command that supports the RECORD scope), the record is not ignored even if marked for deletion. Additionally, SET DELETED ON has no affect on INDEX or REINDEXing.

RECALL ALL honors SET DELETED and does not recall any records.

Notes

. Filtering deleted records in a single work area: To confine the filtering of deleted records to a particular work area, SELECT the work area, and then SET FILTER TO DELETED().

Examples

      .  This example illustrates the effect of using SET DELETED:

      USE Sales NEW
      ? LASTREC()                  // Result: 84
      //
      DELETE RECORD 4
      COUNT TO nCount
      ? nCount                     // Result: 84
      //
      SET DELETED ON
      COUNT TO nCount
      ? nCount                     // Result: 83

Seealso

DELETE, DELETED(), RECALL, SET FILTER

SET CURSOR

SET CURSOR

Toggle the screen cursor on or off

Syntax

      SET CURSOR ON | off | <xlToggle>

Arguments

ON enables the cursor display.

OFF disables the cursor display.

<xlToggle> is a logical expression that must be enclosed in parentheses. A value of true (.T.) is the same as ON, and a value of false (.F.) is the same as OFF.

Description

SET CURSOR toggles the screen cursor on or off. When the CURSOR is OFF, keyboard entry and screen display are unaffected. The cursor is merely hidden and data entry may still be accomplished without the cursor being visible. ROW() and COL() are updated as if the cursor were visible.

This command suppresses the cursor while the screen is being painted. Ideally, the only time the cursor shows in a production program is when the user is editing GETs, MEMOEDIT(), or some kind of line edit.

Examples

      .  This example shows a typical use of SET CURSOR:

      LOCAL lAnswer := .F.
      @ 24, 0
      @ 24, 15 SAY "Do you want to QUIT? [Y/N]";
         GET lAnswer;
         PICTURE "Y"
      SET CURSOR ON
      READ
      SET CURSOR OFF

Seealso

COL(), ROW(), SET CONSOLE, SETCURSOR(), SETPOS()

SET CONFIRM

SET CONFIRM

Toggle required exit key to terminate GETs

Syntax

      SET CONFIRM on | OFF | <xlToggle>

Arguments

ON requires the user to press an exit key to leave a GET.

OFF allows the user to leave a GET by typing past the end without pressing an exit key.

<xlToggle> is a logical expression that must be enclosed in parentheses. A value of true (.T.) is the same as ON, and a value of false (.F.) is the same as OFF.

Description

SET CONFIRM determines whether an exit key is required to leave a GET. If CONFIRM is OFF, the user can type past the end of a GET and the cursor will move to the next GET, if there is one. If there is not another GET, the READ terminates. If, however, CONFIRM is ON, an exit key must be pressed to leave the current GET.

In all cases, attempting to leave the current GET executes the RANGE or VALID clauses, unless the user presses the Esc key. See @…GET for more information on the behavior of GETs.

Seealso

@…GET, READ, SET BELL

SET COLOR

SET COLOR*

Define screen colors

Syntax

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

Arguments

<standard> is the color that paints all console, full-screen, and interface commands and functions when displaying to the screen. This includes commands such as @…PROMPT, @…SAY, and ?; as well as functions such as ACHOICE(), DBEDIT(), and MEMOEDIT().

<enhanced> is the color that paints highlighted displays. This includes GETs with INTENSITY ON, the MENU TO, DBEDIT(), and ACHOICE() selection highlight.

<border> is the color that paints the area around the screen that cannot be written to.

<background> is not currently supported by any machines for which Computer Associates provides drivers. This setting is supplied for compatibility purposes only.

<unselected> is a color pair that provides input focus by displaying the current GET in the enhanced color while other GETs are displayed in this color.

<cColorString> is a character string enclosed in parentheses containing the color settings. This facility lets you specify the color settings as an expression in place of a literal string or macro variable.

SET COLOR TO with no argument restores the default colors to W/N, N/W, N, N, N/W.

Description

SET COLOR, a command synonym for the SETCOLOR() function, defines colors for subsequent screen painting activity. Each SET COLOR command specifies a list of color settings for the five types of screen painting activity. Each setting is a foreground and background color pair separated by the slash (/) character. Foreground defines the color of characters displayed on the screen. Background defines the color displayed behind the character. Spaces and nondisplay characters display as background only.

In addition to color, a foreground setting can have an attribute, high intensity or blinking. With a monochrome display, high intensity enhances brightness of painted text. With a color display, high intensity changes the hue of the specified color making it a different color. For example, N displays foreground text as black where N+ displays the same text as gray. High intensity is denoted by +. The blinking attribute causes the foreground text to flash on and off at a rapid interval. Blinking is denoted with *. An attribute character can occur anywhere in a setting, but is always applied to the foreground color regardless where it occurs.

Each color can be specified using either a letter or a number, but numbers and letters cannot be mixed within a setting. Note that numbers are supplied for compatibility purposes and are not recommended.

All settings are optional. If a setting is skipped, its previous value is retained with only new values set. Skipping a foreground or background color within a setting sets the color to black.

The following colors are supported:

         Color Table
         -----------------------------------------------------------------------
         Color          Letter    Number  Monochrome
         -----------------------------------------------------------------------
         Black          N, Space  0       Black
         Blue           B         1       Underline
         Green          G         2       White
         Cyan           BG        3       White
         Red            R         4       White
         Magenta        RB        5       White
         Brown          GR        6       White
         White          W         7       White
         Gray           N+        8       Black
         Bright Blue    B+        9       Bright Underline
         Bright Green   G+        10      Bright White
         Bright Cyan    BG+       11      Bright White
         Bright Red     R+        12      Bright White
         Bright Magenta RB+       13      Bright White
         Yellow         GR+       14      Bright White
         Bright White   W+        15      Bright White
         Black          U                 Underline
         Inverse Video  I                 Inverse Video
         Blank          X                 Blank
         -----------------------------------------------------------------------

SET COLOR is a compatibility command and is not recommended. It is superseded by the SETCOLOR() function which can return the current color as well as set a new color.

Notes

. Monochrome monitors: Color is not supported on monochrome monitors. Clipper, however, supports the monochrome attributes inverse video (I) and underlining (U).

. Screen drivers: SET COLOR TO, using numbers, may not be supported by screen drivers other than the default screen driver.

Examples

      .  This example uses the unselected setting to make the current
         GET red on white while the rest are black on white:

          cColor:= "W/N,R/W,,,N/W"
          SET COLOR TO (cColor)
          cOne := cTwo := SPACE(10)
          @ 1, 1 SAY "Enter One: " GET cOne
          @ 2, 1 SAY "Enter Two: " GET cTwo
          READ

       .  In this example a user-defined function gets a password from
          the user using the blank (X) enhanced setting to hide the password as
          the user types:

          IF !DialogPassWord(12, 13, "W+/N", "FUNSUN", 3)
             ? "Sorry, your password failed"
             QUIT
          ENDIF

          FUNCTION DialogPassWord( nRow, nCol, ;
                 cStandard, cPassword, nTries )
             LOCAL nCount := 1, cColor := SETCOLOR()
             SET COLOR TO (cStandard + ", X")      // Blank input
             //
             DO WHILE nCount < nTries
                cUserEntry:= SPACE(6)
                @ nRow, nCol SAY  "Enter password: " GET ;
                         cUserEntry
                READ
                //
                IF LASTKEY() == 27
                   SET COLOR TO (cColor)
                   RETURN .F.

                ELSEIF cUserEntry == cPassword
                   SET COLOR TO (cColor)
                   RETURN .T.
                ELSE
                   nCount++
                ENDIF
             ENDDO
             //
             SET COLOR TO (cColor)
             RETURN .F.

Seealso

@…GET, @…SAY, ISCOLOR(), SETCOLOR(), SETBLINK()

SET AUTOSHARE

SET AUTOSHARE

Defines network detection for shared file access.

Syntax

      SET AUTOSHARE TO [<nMode>]

Arguments

<nMode> A numeric value 0, 1 or 2 can be specified for <nMode>. The default is 0. If omitted, the network detection mode is switched off.

Description

SET AUTOSHARE is a compatibility command useful for changing a multi-user application to a stand-alone application by changing one line of code in the start routine of a program.

This requires changing only the value of <nMode>:

                    Values for SHARE mode detection
         ---------------------------------------------------------
         Value   Description
         -----   -------------------------------------------------
           0     Disables SHARE mode detection ( default )
           1     Opens database SHARED in a network, and EXCLUSIVE
                 if no network is detected
           2     Always opens databases EXCLUSIVE

To take advantage of SET AUTOSHARE, an application must be programmed for multi-user access, respecting the rules for network programming. For example, record locks must be obtained with RLock() before changing field variables. This way, a multi-user application is created.

To change this application to a single user version, SET AUTOSHARE TO 2 is coded in the start routine.

A developer can SET AUTOMODE TO 1 on the development machine. In this case, performance advantages from EXCLUSIVE file access are available during the development cycle, while SHARED file access is granted in a multi-user environment.

Seealso

Set(), SET AUTOPEN, SET AUTORDER, USE

SET AUTORDER

SET AUTORDER

Defines the default controlling index for automatically opened index files.

Syntax

      SET AUTORDER TO <nOrder>

Arguments

<nOrder> This is a numeric value specifying the ordinal position of the index to select as the controlling index when SET AUTOPEN is set to ON. The default is zero.

Description

When SET AUTOPEN is set to ON and the RDD supports automatic opening of structural indexes, the SET AUTORDER command specifies the index to activate as the controlling index. The default value for <nOrder> is zero, i.e. no controlling index is activated when an index file is automatically opened with the USE command. In this case, records of the database are accessible in physical order in the work area.

Note

Refer to SET AUTOPEN for an example of automatic selection of the controlling index.

Seealso

OrdSetFocus(), Set(), SET AUTOPEN, SET AUTOSHARE, USE

SET AUTOPEN

SET AUTOPEN

Toggles automatic opening of a structural index file

Syntax

      SET AUTOPEN ON | off | (<lOnOff>)

Arguments

ON | off | (<lOnOff>) The option toggles if a structural index file is automatically opened with the USE command. With ON or .T. (true), an index file is automatically opened. OFF or .F. (false) switch this mode off.

Description

Some replaceable database drivers support automatic opening of index files with the USE command when the index file has the same file name as the database file (without extension). An example is the DBFCDX driver. SET AUTOPEN toggles this behavior.

When SET AUTOPEN is set to ON, which is the default, the USE command automatically opens an index file having the same name as the database file and the file extension returned from OrdBagExt().

Note

If an index file is automatically opened, a controlling index is not activated. The default index order is zero, i.e. records are accessible in physical order in the work area. To select a controlling index, call OrdSetFocus() or use SET AUTORDER for a default controlling index

Example

      // The example demonstrates the effect of SET AUTOPEN with the
      // DBFCDX driver.

      REQUEST DBFCDX

      PROCEDURE Main

         RddSetDefault( "DBFCDX" )
         SET AUTOPEN OFF

         USE Customer
         INDEX ON CustID                    TAG ID   TO Customer
         INDEX ON Upper(LastName+FirstName) TAG Name TO Customer

          USE Customer
          ? OrdCount(), OrdKey()        // result: 0  ""

          SET AUTOPEN ON

          USE Customer
          ? OrdCount(), OrdKey()        // result: 2  ""

          SET AUTORDER TO 1

          USE Customer
          ? OrdCount(), OrdKey()        // result: 2  CUSTID
          ? Ordkey( 2 )                 // result: Upper(LastName+FirstName)

          USE
       RETURN

Seealso

OrdListAdd(), OrdSetFocus(), Set(), SET AUTORDER, SET AUTOSHARE, USE