home *** CD-ROM | disk | FTP | other *** search
- /*********************************************************************
- *
- * Name: DISPSETS() - Extension UDF() Sample Debug Tool
- * Description: Displays Clipper 5.0 current global settings
- * Author: Philip H. Schwartz
- * Audience: Nantucket DEVCON '90
- * Written: June 4, 1990
- * Compiler: Clipper 5.0 V7.7 BETA
- * Comp Option:
- * Linker: RTLink Version 1.3 (Clipper)
- * Library: clipper, extend
- * Obj Module:
- * Link input: rtlink fi example4 out example4 li clipper,extend
- * Headers: STD.ch, SET.ch
- * Copyright: (c) 1990 Philip H. Schwartz
- * Rights: All Commercial & Publishing Rights Reserved
- *
- *********************************************************************/
-
- #include "set.ch"
-
- #define DEMO // remove this to compile UDF only
-
- #define BETA // BETA version of SET() doesn't
- // work. Delete this line for
- // version that works.
- #ifdef DEMO
- /* The test program consists of the following lines */
- CLS
- DispSets() // display global settings
- RETURN
- #endif
-
- /* This function displays the current global settings in Clipper 5.0.
- It would be very easy to modify the routine to allow changing
- these settings. This will be discussed in the DEVCON talk. */
- FUNCTION DispSets
- LOCAL aSET,aSetCurrent[_SET_COUNT],nSetCount,cSaveScreen,i
-
- aSET:={"SET EXACT",;
- "SET FIXED",;
- "SET DECIMALS",;
- "SET DATE",;
- "SET EPOCH",;
- "SET PATH",;
- "SET DEFAULT",;
- "SET EXCLUSIVE",;
- "SET SOFTSEEK",;
- "SET UNIQUE",;
- "SET DELETED",;
- "SETCANCEL()",;
- "ALTD()",;
- "SETCOLOR()",;
- "SETCURSOR()",;
- "SET CONSOLE",;
- "SET ALTERNATE",;
- "SET ALTERNATE TO",;
- "SET DEVICE",;
- "SET PRINTER",;
- "SET PRINTER TO",;
- "SET MARGIN",;
- "SET BELL",;
- "SET CONFIRM",;
- "SET ESCAPE",;
- "READINSERT()",;
- "READEXIT()",;
- "SET INTENSITY",;
- "SET SCOREBOARD",;
- "SET DELIMITERS",;
- "SET DELIMITERS TO",;
- "SET WRAP",;
- "SET MESSAGE",;
- "SET MESSAGE (CENTERED)"}
-
- cSaveScreen=SAVESCREEN(0,0,24,79) // save original screen
-
- nSetCount=MIN(LEN(aSet),_SET_COUNT) // SET() values are version dependent,
- // but the character string
- // values are hard-wired. So we
- // limit the FOR/NEXT argument
- // to whichever is less: _SET_COUNT
- // or size of the string array.
-
- FOR i=1 TO nSetCount
- #ifdef BETA
- aSetCurrent[i]=PAD(aSet[i],30)+" "+;
- IIF(i>=12 .AND. i<=15,"This function is BROKE", LTRIM(SetFmt(SET(i))))
- #else
- aSetCurrent[i]=PAD(aSet[i],30)+" "+LTRIM(SetFmt(SET(i)))
- #endif
- NEXT
-
- CLS
- @ 1,0 TO 24,79 DOUBLE // draw the ACHOICE frame
- nChoice=ACHOICE(2,1,23,78,aSetcurrent) // show values with ACHOICE
-
- RESTSCREEN(0,0,24,79,cSaveScreen) // restore original screen
- RETURN NIL
-
- /* This function formats the passed SET() variable
- based on the type of its returned value */
- FUNCTION SetFmt
- PARAMETER SetVariable
- DO CASE
- CASE VALTYPE(SetVariable)="C"
- RETURN(SetVariable)
- CASE VALTYPE(SetVariable)="N"
- RETURN(STR(SetVariable))
- CASE VALTYPE(SetVariable)="L"
- RETURN(IIF(SetVariable,"ON (TRUE)","OFF (FALSE)"))
- OTHERWISE
- RETURN("NOT SUPPORTED TYPE")
- ENDCASE
- RETURN NIL
- /*EOF*/
-