Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- dBsee 4.6 - The Library - <b>dfset()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
dfSet()
Sets a system setting
------------------------------------------------------------------------------
Syntax:

     dfSet( <nVal>, [<uNewSet>], [<lNull>] ) --> uSet

Parameters:

     <nVal>     Setting to be verified. The settings that can be verified
     are defined in dfSet.ch and are prefixed by "AI_"
     (Application Init).
     #include "dfSet.ch"
     +------------------------------------------------------------------+
     |TYPE | Define                 | Description                       |
     |-----+------------------------+-----------------------------------|
     |Num  |AI_USERLEVEL            | User security level               |
     |Char |AI_USERNAME             | User name                         |
     |Num  |AI_ZOOMBOX              | Zoom speed                        |
     |Num  |AI_ZOOMSOUND            | Zoom sound                        |
     |Logic|AI_INDEXPACK            | Index packing                     |
     |Logic|AI_NET                  | Network                           |
     |Num  |AI_LOCKREPEATTIME       | Retry timeout                     |
     |Logic|AI_MOUSE                | Graphical mouse pointer           |
     |Char |AI_TABNAME              | Table file name                   |
     |Char |AI_TABINDEX1            | Table index file name             |
     |Logic|AI_TABMODIFY            | Table modifyable                  |
     |Num  |AI_GETTIMEOUT           | GET timeout time                  |
     |Num  |AI_GETWARNING           | GET idle before timeout time      |
     |Logic|AI_USEGETTIMEOUT        | GET timeout enabled               |
     |Num  |AI_CONSOLELINES         | Number of display lines           |
     |Char |AI_SHADOWCOLOR          | Shadow color                      |
     |Char |AI_DEFAULTPRINTER       | Default printer                   |
     |Char |AI_DEFAULTPORT          | Default printer port              |
     |Char |AI_OBJECTOFFCOLOR       | Object OFF color                  |
     |Char |AI_INIVERSION           | INI file version                  |
     |Logic|AI_CLEARSCREEN          | Clear screen at startup           |
     |Logic|AI_FONTREDEFINITION     | Font redefinition allowed         |
     |Char |AI_SCREENCOLOR          | Background color                  |
     |Logic|AI_INIMESSAGE           | Display INI messages at startup   |
     |Logic|AI_ALTF4ISACTIVE        | Activate Alt-F4                   |
     |Logic|AI_SCRSAVERACTIVE       | Activate SCREEN SAVER             |
     |Num  |AI_SCRSAVERTIME         | SCREEN SAVER idle time            |
     |Logic|AI_FASTMENUALT          | Activate menu if only ALT pressed |
     |Logic|AI_FILEMODIFY           | File modifyable from DDWIN        |
     |Logic|AI_USRICON              | Activate User Icon                |
     |Logic|AI_USRSTATE             | Activate User State               |
     |Logic|AI_FASTMENUEXIT         | Activate Fast EXIT on menu ESC    |
     |Logic|AI_FASTDISPLAY          | Activate Fast Form Display        |
     |Logic|AI_ERRORINWINDOW        | Activate Error Window             |
     |Logic|AI_GETCHECKUAR          | Check "uar" key in get system     |
     |Logic|AI_IFNOKEYREPEATGET     | Repeat get in ddkey               |
     |Logic|AI_GOTOWINAFTERRETURN   | Call window in ddkey              |
     |Char |AI_MENUSCREENFILL       | Menu Screen Fill                  |
     |Char |AI_MENUSCREENCOLOR      | Menu Screen Fill Color            |
     |Logic|AI_DISABLEKEYINDEX      | Disable index on key search       |
     |Logic|AI_FILTEROPTIMIZER      | Disable filter optimizer          |
     |Char |AI_DDKEYMESSAGE         | DDKey message                     |
     |Logic|AI_AS400INIT            | Activate the init on AS/400       |
     |Block|AI_FILEINSERTCB         | Codeblock on file insert          |
     |Block|AI_TABLEINSERTCB        | Codeblock on table insert         |
     |Logic|AI_CALCULATORGET        | Calculator get                    |
     |Char |AI_LOGFILE              | Log file                          |
     |Char |AI_NULLIFY_CHAR         | Default for NULLIFY on CHAR       |
     |Date |AI_NULLIFY_DATE         | Default for NULLIFY on DATE       |
     |Logic|AI_NULLIFY_LOGICAL      | Default for NULLIFY on LOGICAL    |
     |Num  |AI_NULLIFY_NUMERIC      | Default for NULLIFY on NUMERIC    |
     |Logic|AI_FORMCHECKESC         | Check esc if leave form           |
     |Logic|AI_MAXMEM               | Decrease the use of the memory    |
     |Logic|AI_ENABLESEARCHKEY      | Enable the F7 key on the Window   |
     |Logic|AI_DISABLEUSEMESSAGE    | Disable the message at the USE    |
     |Logic|AI_AUTOMATICCOMPOUND    | Enable the compound manage        |
     |Logic|AI_FORTRESSINIT         | Enable the FortRess server Login  |
     |Logic|AI_AS400DISABLECLOSE    | Disable the close of AS/400 tables|
     |Char |AI_BUTDISABLEDPROMPT    | PROMPT color of disabled buttons  |
     |Char |AI_BUTDISABLEDHOTKET    | HOTKEY color of disabled buttons  |
     |Logic|AI_ENABLEUSERTRACE      | Enable the application trace      |
     |Logic|AI_WINDOWINFO           | Enable window information         |
     |Logic|AI_INDEXPROGRESSBAR     | Enable index progressbar          |
     |Logic|AI_DISABLENOTHINGTOPRINT| Disable printer message           |
     |Logic|AI_WIN95INTERFACE       | New interface                     |
     |Logic|AI_DATEMESSAGE          | Enable date error message         |
     |Logic|AI_DISABLELABELPRINT    | Disable label printing            |
     |Logic|AI_DISABLEALLCLOSE      | Disable database close            |
     |Logic|AI_DISABLEPRINTERSAVE   | Disable report.ini save           |
     |Char |AI_LOGMESSAGE           | Enable message log                |
     |Char |AI_DISABLEMGNOPT        | Disable Margin Optimizer          |
     |Num  |AI_IDLETIME             | Set the Windows NT idle time      |
     |Logic|AI_HIDEMENUITEM         | Disable the unreached menu entity |
     |Logic|AI_DISABLEKEYOPT        | Disable the DDKEY optimization    |
     |Block|AI_TABLECHECKCB         | Codeblock for table check         |
     |Logic|AI_DISABLEREPORTFILTER  | Disable the filer button on report|
     |Block|AI_EDITCELLCB           | Codeblock di controllo EditCell   |
     |Logic|AI_50ROWFORM            | Enable 50 Row Form                |
     |Logic|AI_UPDCREATEBAK         | Enable the .BAK creation un /UPD  |
     |Logic|AI_MULTILINEBUTTON      | Enable the multiline button       |
     |Logic|AI_DISABLESTATISTIC     | Enable the statistic CTRL+T       |
     |Logic|AI_PROGRAMMINGHELP      | Enable the programmable HELP      |
     |Block|AI_TABLEFILTER          | Set a filter on a table file      |
     |Logic|AI_EXACTKEYFOUND        | Serch for equal key               |
     +------------------------------------------------------------------+
     NEVER use the numbers but ALWAYS use the DEFINE statements.
     This  guarantees  compatibility  with  future  versions  of
     dBsee.  It  is  possible  to  write  a  custom SCREEN SAVER
     module.  The  SCREEN SAVER module  will be called after the
     AI_SCRSAVERTIME time has elapsed, and no keyboard input has
     been  detected.  This function  must be called dfScrSaver()
     and unload upon NEXTKEY()!=0.
     <uNewSet>  New Set to assign
     <lNull>    If .T. enable the setting if a NIL value. DEFAULT .F.

Returns:

     <uSet> Current value

Description:

     Sets a system setting and returns current value

Example:

     #include "dfSet.ch".
     
     IF dfSet (AI_NET)
           dbMsgErr ( "The program is designed for "+;
                      "the NETWORK")
     ENDIF
     
     . Permits the use of the program if configured
       for the network.
     
     
     
     dfSet (AI_USERLEVEL, 99)
     
     . Set or control the user level.
     
     
     
     dfSet (AI_USERNAME, "Mark")
     
     . Set or control or verify the users name.
     
     
     
     dfSet (AI_ZOOMBOX, 10)
     
     . Modifies the velocity (speed) of the zoom of a
       message window.
     
     
     
     dfSet (AI_ZOOMSOUND, 0)
     
     . Disable or set the sound omitted with a message.
     
     
     
     dfSet (AI_INDEXPACK, .T.)
     
     . Qualifies PACKing of the files during the index
       rebuilding.
     
     
     
     dfSet (AI_NET, .T.)
     
     . Set the program for network use.
     
     
     
     dfSet (AI_LOCKREPEATTIME, 120)
     
     . Set the locked file retry time to 2 minutes on
       the Network.
     
     
     
     IF dfSet (AI_MOUSE)
        dbMsgErr ( "Graphic Mouse pointer is active")
     ENDIF
     
     . Controls the setting of the Mouse pointer (graphic
       or non-graphic).
     
     
     
     dfSet (AI_TABNAME, "TabName")
     
     . Set the name of table files.
     
     
     
     dfSet (AI_TABINDEX1, "TabIndex")
     
     . Set the name of the index used with the table.
     
     
     
     dfSet (AI_TABMODIFY, .F.)
     
     . doesn't permit the modification of the tables.
     
     
     
     dfSet (AI_GETTIMEOUT, 120)
     
     . Sets timeout delay time of the get to 2 minutes.
     
     
     
     dfSet (AI_GETWARNING, 30)
     
     . Sets the delay time to notify of a timeout warning
       to 30 seconds.
     
     
     
     IF dfSet( AI_USEGETTIMEOUT )
        dbMsgErr("Timeout enabled")
     ENDIF
     
     . CONTROLLA the timeout feature during the get phase.
     
       ATTENZIONE
       This it's a READONLY setting
     
     
     IF dfSet (AI_CONSOLELINES)== 50
        [dbMsgErr] ( "Program to 50 Lines")
     ENDIF
     
     . Set the Number of video display lines.
     
     
     
     dfSet (AI_SHADOWCOLOR, "W+/ B")
     
     . Set the shadow color on the forms.
     
     
     
     dfSet (AI_DEFAULTPRINTER," 107")
     
     . Set the default Printer.
     
     
     
     dfSet (AI_DEFAULTPORT, "LPT1")
     
     . Set the default printer port.
     
     
     
     dfSet (AI_OBJECTOFFCOLOR, "W+/ N")
     
     . Color object when not active (turned OFF).
     
     
     
     IF dfSet (AI_INIVERSION)#" 4.1"
        dbMsgErr( "Version of the Ini file is NOT "+;
                  "current")
     ENDIF
     
     . Version of the ini file.
     
     
     
     IF dfSet (AI_CLEARSCREEN)
        ?  "departure with CLS"
     ENDIF
     
     . Clear the video screen at start of the program.
       Change of this setting will have no effect.
     
     
     
     IF! dfSet (AI_FONTREDEFINITION)
        dbMsgErr ( "The system does support font "+;
                   "redefinition")
     ENDIF
     
     . Determine the status of font redefinition.
       Change of this setting will have no effect.
     
     
     
     dfSet (AI_SCREENCOLOR, "W+/ B")
     
     . Color of the background fill color.
       Change of this setting will have no effect.
     
     
     
     dfSet (AI_INIMESSAGE, .F.)
     
     . Display Ini messages during startup ( disabled ).
       Change of this setting will have no effect.
     
     
     
     dfSet (AI_ALTF4ISACTIVE, .F.)
     
     . Disables ALT+ F4 key combination.
     
     
     
     dfSet (AI_SCRSAVERACTIVE, .F.)
     
     .  Disable the SCREEN SAVER.
     
     
     
     dfSet (AI_SCRSAVERTIME, 30)
     
     . Activation of the SCREEN SAVER after 30 Seconds.
     
     
     
     dfSet (AI_FASTMENUALT, .F.)
     
     . Disable the activation of the menu with only a
       press the Alt Key.
     
     
     
     dfSet (AI_FILEMODIFY, .F.)
     .  Disable the insertion, modification and
        deletetion from DDWIN.
     
     
     
     dfSet (AI_USRICON, .F.)
     
     . Disable the icons in the line messages.
     
     
     
     dfSet (AI_USRSTATE, .F.)
     
     . Disable the state in the line messages.
     
     
     
     dfSet (AI_FASTMENUEXIT, .T.)
     
     . Activates the exit immediate exit from the menu
       with the ESC key in this  mode the user is forced
       to press 2 ESC times to get out of the application.
     
     
     
     dfSet (AI_FASTDISPLAY, .F.)
     
     . Disable the faster screen display of complex forms.
     
     
     
     dfSet (AI_ERRORINWINDOW, .F.)
     
     . Disables the display of errors in a window, when an
       error occurs in the application. Disabling this
       window will  result in the errors being displayed
       as a list on the screen.
     
     
     
     dfSet (AI_GETCHECKUAR, .T.)
     
     . Activate the control of the POSTGET  when a key is
       pressed "uar" and "Stb" to the inside of the get
       system.
     
     
     
     dfSet (AI_IFNOKEYREPEATGET, .T.)
     
     . Permits the search to recur into GET phase if the
       record positioning not gone to the end-of-file.
     
     
     
     dfSet (AI_GOTOWINAFTERRETURN, .T.)
     
     . Allows the display a search window after the
       confirmation of  the search key.
     
     
     
     dfSet (AI_MENUSCREENFILL, "#########")
     dfSet (AI_MENUSCREENCOLOR, "B/ N")
     
     . These two characteristics when used together
       define how the applications menu appears.
       Set the FILL character with dfSet(AI_MENUSCREENFILL)
       and  the color with dfSet(AI_MENUSCREENCOLOR).
     
     
     
     dfSet (AI_DISABLEKEYINDEX, .T.)
     
     . Disable the use of temporary indexes on the keys.
     
     
     
     dfSet (AI_FILTEROPTIMIZER, .F.)
     
     . Disable the query optimizer.
       Disable the query optimizer is useful if composite
       indexes are being used. The operation may slow down
       the printing, but will resolve possible
       errors with the filtered conditions.
     
     
     
     dfSet (AI_DDKEYMESSAGE, "F7 for open the window")
     
     . Active the message on the DDKEY.
     
     
     
     dfSet (AI_AS400INIT, .F.)
     
     .  Disable the initialization when using a AS/ 400.
     
     
     
     dfSet (AI_FILEINSERTCB,{| [cFile]| [cFile]== "CLI"})
     
     . Set the insertion from only LOOKUP on the file "CLI"
     
     
     
     dfSet (AI_TABLEINSERTCB,{| [cFile]| [cFile]== "CLI"})
     
     . Set the insertion from only LOOKUP on the
       table "CLI"
     
     
     
     dfSet (AI_CALCULATORGET, .T.)
     
     . Sets all the numeric GET's for right justification.
     
     
     
     dfSet (AI_LOGFILE, "c:\ [dbstart.log]")
     
     . Change the log file used by the generated
       application.
     
     
     
     dfSet (AI_NULLIFY_CHAR,"")
     dfSet (AI_NULLIFY_DATE, CTOD (" 01/ 01/ 90"))
     dfSet (AI_NULLIFY_LOGICAL, .T.)
     dfSet (AI_NULLIFY_NUMERIC, 0)
     
     . Allows the change of the values of dfNullify.
     
     
     
     dfSet (AI_FORMCHECKESC, .F.)
     
     . Disable the check for a "esc" key press on the form.
     
     
     
     dfSet (AI_MAXMEM, .T.)
     
     . Reduces the minimum memory requirements for the
       application.
     
     
     
     dfSet (AI_ENABLESEARCHKEY, .T.)
     
     . Activate the automatic search key F7 on all browse,
       listbox and windows that will allow it.
     
     
     
     dfSet (AI_DISABLEUSEMESSAGE, .T.)
     
     . Disable the display of messages when opening the
       data files (ddUse, dfUse) and on the check of the
       existence of the databases (ddIndex()).
     
     
     
     dfSet (AI_AUTOMATICCOMPOUND, .T.)
     
     . Set the automatic management of the compound indexes
       if the used RDD database allows them.
     
     
     dfSet( AI_FORTRESSINIT, .T. )
     
     . Enable the FortRess server Login
     
     
     dfSet( AI_AS400DISABLECLOSE, .T. )
     
     . Disable the close of the AS/400 tables
     
     
     dfSet( AI_BUTDISABLEDPROMPT, "W+/R" )
     dfSet( AI_BUTDISABLEDHOTKET, "W+/R" )
     
     . Define the disabled button colors
     
     
     dfSet( AI_ENABLEUSERTRACE, .T. )
     
     . Enable the application trace
     
     
     dfSet( AI_WINDOWINFO, .T. )
     
     . Print the name of the source in the last line of the
       form
     
     
     dfSet( AI_DISABLENOTHINGTOPRINT, .T. )
     
     . Disable the message "Nothing to print"
     
     
     dfSet( AI_INDEXPROGRESSBAR, .T. )
     
     . Print a ProgrssBarr during the reindex
     
     
     dfSet( AI_WIN95INTERFACE, .T. )
     
     . Enable the Windows 95 Interface
     
     
     dfSet( AI_DATEMESSAGE, .T. )
     
     . Enable the message on invalid date
     
     
     dfSet( AI_DISABLELABELPRINT, .T. )
     
     . Disable the label printing (CTRL+L)
     
     
     dfSet( AI_DISABLEALLCLOSE, .T. )
     
     . Disable all the file close
     
     
     dfSet( AI_DISABLEPRINTERSAVE, .T. )
     
     . Disable the save on report.ini of the printer of the
       report
     
     
     dfSet( AI_LOGMESSAGE, 1 )
     
     . Enable the log of the message on the handle 1
     
     
     dfSet( AI_LOGMESSAGE, "dbstart.log" )
     
     . Enable the log of the message on the file
       dbstart.log
     
     
     dfSet( AI_DISABLEMGNOPT, .T. )
     
     . Disable the Margin optimizer
     
     
     dfSet( AI_IDLETIME, 150 )
     
     . Set the IDLE time of the dBsee applicaiotns, in this
       way you can decrease the CPU usage with  Windows NT,
       95 or OS/2.
       The default is 0 dfSet( AI_IDLETIME, 0 ), no idle
       time. A more high value can decrease more the CPU
       usage dfSet( AI_IDLETIME, 300 )
     
     
     dfSet( AI_HIDEMENUITEM, .T. )
     
     . Disable the menu item with key not available
     
     
     
     dfSet( AI_DISABLEKEYOPT, .T. )
     
     . Disable the DDKEY optimization on Filtered DDKEY()
     
     
     
     dfSet( AI_TABLECHECKCB,;
                 {|ab,cTab,cFie|MyFun(ab,cTab,cFie)} )
     
     . In this way you can check all the table field
     
       *********************************************
       STATIC FUNCTION MyFun( nPrePost, cTab, cFie )
       *********************************************
       LOCAL lRet:=.T.
     
       DO CASE
          CASE nPrePost == FORM_PREGET
     
          CASE nPrePost == FORM_POSTGET .OR.;
               nPrePost == FORM_CHKGET
     
               IF cTab=="TABCLI" .AND.;
                  cFie=="CODCLI"
                  // Check
               ENDIF
     
               IF nPrePost == FORM_POSTGET
                  // ..........
               ENDIF
     
       ENDCASE
     
       RETURN lRet
     
     
     dfSet( AI_DISABLEREPORTFILTER, .T. )
     
     . Disable the filter button on the report
     
     
     * #COD OBEXE0
     dfSet( AI_EDITCELLCB, {|a,b,c,d|x(a,b,c,d)} )
     * #END
     
     * #################
     FUNCTION x(a,b,c,d)
     * #################
     LOCAL lRet := .T.
     
     IF a = FORM_CHKGET
        IF c=="CLI" .AND. d=="RAGCLI"
           lRet := "DBSEE"$UPPER(b)
           IF !lRet
              dbMsgErr("This field must contain [DBSEE]")
           ENDIF
        ENDIF
     ENDIF
     
     RETURN lRet
     
     . This code check if the filed CLI->RAGCLI
       contains the value dBsee during one EditCell
       The codeblock parameter are
       a = Typer of call = FORM_PREGET o FORM_CHKGET
       b = Edit Var to check or modify
       c = File
       d = Field
     
     
     dfSet( AI_50ROWFORM, .T. )
     
     . Enable the use of form at the resolution of 50 rows
     
     
     dfSet( AI_UPDCREATEBAK, .F. )
     
     . Disable the .BAK e .BA2 creation during the /UPD
     
     
     dfSet( AI_MULTILINEBUTTON, .F.  )
     
     . Disable the multilinebutton
     
     
     dfSet( AI_DISABLESTATISTIC, .T. )
     
     . Disable the statistic engine CTRL+T
     
     
     dfSet( AI_PROGRAMMINGHELP, .T. )
     
     . Enable the Programmable HELP
     
     
     dfSet( AI_TABLEFILTER, {||F_CheckTab()} )
     
     * ###################################################
     FUNCTION F_CheckTab()
     * ###################################################
     LOCAL lRet := .T.
     LOCAL cTab := UPPER(ALLTRIM(DBTABD->TABID))
     DO CASE
        CASE cTab=="TABFIL"
             lRet := !UPPER(ALLTRIM(DBTABD->TABCODE))=="M"
     ENDCASE
     RETURN lRet
     
     . Set a filter on the table TABFIL and field M
     
     
     dfSet( AI_EXACTKEYFOUND, .T. )
     
     . If ddKey() found a value that is not exactly the
       searched value, with this setting, return .F.

See also:

     dbMsgErr(), dfColor()

See Also: dbMsgErr() dfColor()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson