[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SET()
 Inspect or change a system setting
------------------------------------------------------------------------------
 Syntax

     SET(<nSpecifier>, [<expNewSetting>], [<lOpenMode>])
        --> CurrentSetting

 Arguments

     <nSpecifier> is a numeric value that identifies the setting to be
     inspected or changed.  <nSpecifier> should be supplied as a manifest
     constant (see below).

     <expNewSetting> is an optional argument that specifies a new value
     for the <nSpecifier>.  The type of <expNewSetting> depends on
     <nSpecifier>.

     <lOpenMode> is a logical value that indicates whether or not files
     opened for the following settings,

     _SET_ALTFILE, _SET_PRINTFILE, _SET_EXTRAFILE

     should be truncated or opened in append mode.  A value of false (.F.)
     means the file should be truncated.  A value of true (.T.) means the file
     should be opened in append mode.  In either case, if the file does not
     exist, it is created.

     If this argument is not specified, the default is append mode.

 Returns

     SET() returns the current value of the specified setting.

 Description

     SET() is a system function that lets you inspect or change the values of
     the CA-Clipper system settings.  For information on the meaning and
     legal values for a particular setting, refer to the associated command
     or function.

     Use a manifest constant to specify the setting to be inspected or
     changed.  These constants are defined in a header file called Set.ch.
     This header file should be included at the top of any source file which
     uses SET().

     Set.ch also defines a constant called _SET_COUNT.  This constant is
     equal to the number of settings that can be changed or inspected with
     SET(), allowing the construction of a generic function that preserves
     all settings (see example below).

     Note:  The numeric values of the manifest constants in Set.ch are
     version-dependent and should never be used directly; the manifest
     constants should always be used.

     If <nSpecifier> or <expNewSetting> is invalid, the call to SET() is
     ignored.

     Set Values Defined in Set.ch
     ------------------------------------------------------------------------
     Constant            Value Type     Associated Command or Function
     ------------------------------------------------------------------------
     _SET_EXACT          Logical        SET EXACT
     _SET_FIXED          Logical        SET FIXED
     _SET_DECIMALS       Numeric        SET DECIMALS
     _SET_DATEFORMAT     Character      SET DATE
     _SET_EPOCH          Numeric        SET EPOCH
     _SET_PATH           Character      SET PATH
     _SET_DEFAULT        Character      SET DEFAULT
     _SET_EXCLUSIVE      Logical        SET EXCLUSIVE
     _SET_SOFTSEEK       Logical        SET SOFTSEEK
     _SET_UNIQUE         Logical        SET UNIQUE
     _SET_DELETED        Logical        SET DELETED
     _SET_CANCEL         Logical        SETCANCEL()
     _SET_DEBUG          Numeric        ALTD()
     _SET_COLOR          Character      SETCOLOR()
     _SET_CURSOR         Numeric        SETCURSOR()
     _SET_CONSOLE        Logical        SET CONSOLE
     _SET_ALTERNATE      Logical        SET ALTERNATE
     _SET_ALTFILE        Character      SET ALTERNATE TO
     _SET_DEVICE         Character      SET DEVICE
     _SET_PRINTER        Logical        SET PRINTER
     _SET_PRINTFILE      Character      SET PRINTER TO
     _SET_MARGIN         Numeric        SET MARGIN
     _SET_BELL           Logical        SET BELL
     _SET_CONFIRM        Logical        SET CONFIRM
     _SET_ESCAPE         Logical        SET ESCAPE
     _SET_INSERT         Logical        READINSERT()
     _SET_EXIT           Logical        READEXIT()
     _SET_INTENSITY      Logical        SET INTENSITY
     _SET_SCOREBOARD     Logical        SET SCOREBOARD
     _SET_DELIMITERS     Logical        SET DELIMITERS
     _SET_DELIMCHARS     Character      SET DELIMITERS TO
     _SET_WRAP           Logical        SET WRAP
     _SET_MESSAGE        Numeric        SET MESSAGE
     _SET_MCENTER        Logical        SET MESSAGE
     ------------------------------------------------------------------------

     Note:  _SET_EXTRAFILE and _SET_SCROLLBREAK have no corresponding
     commands.  _SET_EXTRAFILE lets you specify an additional alternate file,
     and _SET_SCROLLBREAK lets you toggle the interpretation of Ctrl+S.

 Examples

     .  In this example a user-defined function preserves or restores
        all global settings.  This function might be used on entry to a
        subsystem to ensure that the subsystem does not affect the state of
        the program that called it:

        #include "Set.ch"
        //

        FUNCTION SetAll( aNewSets )
           LOCAL aCurrentSets[_SET_COUNT], nCurrent
           IF ( aNewSets != NIL )   // Set new and return current
              FOR nCurrent := 1 TO _SET_COUNT
                 aCurrentSets[nCurrent] := ;
                    SET(nCurrent, aNewSets[nCurrent])
              NEXT
           ELSE         // Just return current
              FOR nCurrent := 1 TO _SET_COUNT
                 aCurrentSets[nCurrent] := SET(nCurrent)
              NEXT
           ENDIF
           RETURN (aCurrentSets)

 Files   Library is CLIPPER.LIB, header file is Set.ch.


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