dc_random()..........Return a random number
dc_rddsel()..........Select a default data-driver (RDD)
dc_readalt().........Establish alternate usage of Ctrl-END in table of Gets
dc_readapick().......Pops up array pick-list if GET not valid or double-clicked
dc_readbox().........Create a modal dialog box and Mouse Buttons for DC_ReadModal()
dc_readcapfirst()....Capitalize all first letters of all words in all GETs
dc_readclick().......Evaluate code-block if mouse is double-clicked in a GET
dc_readcolor().......A function for validating color strings in a GET
dc_readcua().........Set CUA-Compliance for Navigating Gets
dc_readcut().........Establish the keys to use for cutting and pasting Gets
dc_readdpick().......Pops up database or array pick-list in a GET
dc_readempty().......Validate that a GET is not empty or display message
dc_reader()..........A Replacement for GetReader() that works with mouse
dc_readhelp()........Post a code-block for F1 help when using DC_ReadModal()
dc_readhelp()........Toggle the "F1=HELP" message on dCLIP dialog screens.
dc_readincr()........A "VALID" function for incrementing a GET value with the mous
dc_readkill()........Return, and/or set, whether current READ should be exited
dc_readmemo()........Insert a memo editor into a table of GETS
dc_readmodal().......A moused replacement for ReadModal()
dc_readnav().........Enable an alternative navigation method for GETS
dc_readonly()........Report if current workarea is Read Only
dc_readvar().........Update a check box or Radio Button GET
dc_readwindow()......Establish scroll-region for DC_ReadModal() GETS
dc_readwrap()........Enable wrapping mode in a table of GETS
dc_recall()..........Pop-up user-prompt menu to recall deleted database records
dc_reclock().........Lock the current record regardless of Rdd (data-driver)
dc_rectag()..........Build or add to a tag array
dc_rectagbrowse()....Pop-up a pick-list of record for tagging and untagging
dc_rectagclear().....Clear all the tags from the tag array
dc_rectagtoggle()....Toggle the current record between Tagged/UnTagged
dc_relarray()........Get an array of child relational info
dc_rename()..........Pop-up a user-prompt menu for renaming a file
dc_replace().........Pop-up a user-prompt menu for replacing database fields
dc_report()..........A Report and Label Form manager
dc_restset().........Restore all Clipper SETs from an array
dc_saveset().........Save all Clipper SETs to an array
dc_say().............Perform @..SAYs relative to coordinates in dc_expl() window
dc_saycenter().......Write a string in the center of an area of the screen
dc_scope()...........Pop-up a menu for creating database scoping conditions
dc_scoperec()........Get the top/bottom record numbers of a "scoped" database
dc_scrldata()........Display a database vertical scroll bar
dc_scrldmou()........Return a record pointer from database scroll-bar mouse-click
dc_scrldthumb()......Enable display of database vertical scroll bar thumb
dc_scrlhbar()........Display a horizontal scroll bar
dc_scrlhmou()........Return an array pointer from horizontal scroll-bar mouse-click
dc_scrlvbar()........Display a vertical scroll bar
dc_scrlvmou()........Return an array pointer from vertical scroll-bar mouse-click
dc_scrnedit()........A Screen Designer/Editor
dc_scrnload()........Load a Screen Group in the Screen Dictionary to an array
dc_scrnpaint().......Paint all screen objects from a screen array
dc_scrnsave()........A "Night-Sky" or Blank-screen screen Saver
dc_scrnstore().......Save a Screen Group array to the Screen Dictionary file
dc_search()..........Search all fields of a database for a value
dc_select()..........Pop-up a pick-list of open workarea aliases
dc_setarray()........Returns an array with complete SET environment information
dc_setdclip()........Set the directory to use for dCLIP data-dictionary files
dc_setdefault()......Set the DEFAULT directory the right way
dc_setedit().........Edit the SET environment from a pick-list menu
dc_setfilter().......Set a filter from a Query-by-example-style condition builder
dc_setindex()........Pop up picklist of available indexes if index file not found
dc_setkeyrestore()...Restore a "group" of keys that were save with DC_SETKEYSAVE()
dc_setkeysave()......Set a "group" of keys to call the same function/procedure
dc_setoptions()......Set indexing options before building a .IDX/.CDX index
dc_setp()............Send a code sequence to the printer from a pseudo-code
dc_setrdd()..........Return the RDD name of an open data file
dc_setrestore()......Restore all Clipper/dCLIP SETs from a file or array
dc_setsave().........Save all Clipper/dCLIP SETs to a file or array
dc_setscope()........Set a scoping value for the current work area
dc_setstep().........Start or stop source-level debugging mode
dc_sett()............Set or Read an environment variable via an identifier
dc_sort()............Pop-up a user-promt menu for creating a database sort
dc_startscrn().......Save the startup screen
dc_statline()........Display a 3-bar status line of work area information
dc_status()..........Display or print status of all work areas and environment
dc_statwin().........Display a user-configurable window of work area information
dc_step()............Load or clear an expression / procedure into the Step table
dc_str2ar()..........Convert a character string array to a multidimensional array
dc_strudbf().........Copy structure of a file to a dCLIP Structure extended file
dc_struupdate()......Update the structure of the current database
dc_strwrap().........Convert a string to a text array and specify line length
dc_sum().............Pop-up a user-prompt menu for summing selected fields
dc_superrdd()........Return and/or set the SUPER RDD name
dc_tablename().......Return the Database file name of a Work Area
dc_tagallcreate()....Create index tags for all fields in database
dc_tagcreate().......Create new index Tag and add to the open combined index file
dc_tagdelete().......Delete an index Tag from a pick-list of available tags
dc_tagged()..........Determine whether or not the current record is tagged
dc_taginfo().........Return an array of information about tags in a combined index
dc_tagname().........Return the name of an index tag from a controlling order
dc_tagrestore()......Rebuild all Tags in a combined index from a Tag (.DCT) file
dc_tagsave().........Save information about all tags to a Tag (.DCT) file
dc_tagsel()..........Select an index Tag from a pick-list of available tags
dc_tbinkey().........A special version of INKEY() for adding mouse to Tbrowse system
dc_textbrow()........Browse large text files
dc_textmerge().......Merge text with data
dc_token()...........Extract a token from a string
dc_tokenarray()......Parse all tokens in a string to an Array
dc_tokenjustify()....Perform text-justfication of tokens in a string
dc_tokennum()........Determine the number of tokens in a string
dc_tone()............A front-end to Tone() that doesn't lock computer
dc_trace()...........Activate trace mode to profile an application
dc_tracesize().......Set Maximum size of Trace File
dc_tranarray().......Convert a function sequence from a string to an array
dc_trandefault().....Load Default Clipper .CH set(s)
dc_translate().......Translate a command line to an array of functions
dc_trconv()..........Convert a Trace file
dc_tstcond().........Test if a condition is valid
dc_tstfile().........Test for existence or ability to create a file.
dc_turbconfig()......Define the system turbo editor
dc_turbedit()........Invoke a Turbo Edit-Compile-Do sequence
dc_turbo()...........A "turbo-style" integrated development environment (IDE)
dc_tutor()...........A tutoring system for Clipper/dCLIP command ands functions
dc_txtclose()........Close text file
dc_txtcount()........Return the number of lines in an open text file
dc_txteof()..........Is file pointer at end of text file?
dc_txtgoto().........Goto a specified line in a text file
dc_txtline().........Read the current line of a text file
dc_txtlno()..........Report the current line pointer of an open text file
dc_txtopen().........Open a text file for use with Text file functions
dc_txtsize().........Return the size in bytes of an open text file
dc_txtskip().........Skip a specified number of lines in a text file
dc_txtword().........Return value of a word in a String by specifying position
dc_updated().........Determine whether a GET changed during a READ
dc_use().............Pop up pick-list of available data files if file not found
dc_useaindex().......Automatically open index files
dc_useall()..........Opens all data files matching a specified wildcard
dc_usearea().........A front-end to dbUseArea() that tests RDD to prevent errors
dc_useraccess()......Determine if Logged-On user has access to a lock
dc_userfree()........Free the lock on the the User file to allow user access
dc_userinfo()........Get or Set information about Logged-On User
dc_userlock()........Lock or attempt to lock all users out of the system
dc_userlogin().......Log On to system to establish user rights
dc_usermaint().......Maintain the DCUSER.DBF User database
dc_useropen()........Open the DCUSER.DBF User database
dc_userset().........Establish the Logged-On user from the User Database
dc_util()............A menu-driven set of database utilities
dc_valtype().........Validate input parameters and set default values
dc_version().........Returns current dCLIP version
dc_viewlib().........Browse status of loaded dynamic libraries and .obj files
dc_virtcapture().....Capture the current record to the Virtual record
dc_virtreplace().....Replace the current record with the Virtual record
dc_virtrestore().....Restore Virtual record from Virtual (.DCV) file
dc_virtsave()........Save Virtual record to Virtual (.DCV) file
dc_wait()............A mouseable wait-state that clears message line
dc_waiton()..........Display a "Wait" Message in a window to restore later
dc_watch()...........Load / clear an expression to / from the Watch table
dc_watchdisp().......Evaluate Watch Table and display results
dc_watchtable()......Return the watch table array
dc_word2num()........Convert a 2-byte word to a number
dc_work()............A work area file (*.DCW) manager
dc_workarray().......Capture all information about a work area to an array
dc_workbrow()........Browse a Work Area (*.DCW) dictionary file
dc_working().........Display a "Working in Progress" bar
dc_workrestore().....Restore work areas, indexes, relations, etc from a work file
dc_worksave()........Save all info about all work areas to a WORK (*.DCW) file
dc_xorbits().........Logical EXCLUSIVE OR of two integers
dc_xtoc()............Convert any variable type to a character string
dc_yesno()...........Display a YES / NO message box menu
dc_zap().............Zap the database with the proper operator prompts
dc_random()
Return a random number
Syntax:
Arguments:
(nMax) is a value of the maximum number size to return.
If no parameter is passed then the maximum size will
be 255. If a number greater than 255 is passed then
the maximum size will still be 255.
Returns:
A numeric value from 0 to 255
Description:
DC_RANDOM() is used to generate a random number from 0
to 255.
Examples:
? DC_RANDOM()
137
? DC_RANDOM(10)
6
Source/Library:
_DCSCRNS.PRG/.OBJ, DCLIP.LIB
dc_rddsel()
Select a default data-driver (RDD)
Syntax:
Arguments:
(cRdd) is the Driver to highlight in the select window. If no
argument is given, then the first linked in Rdd will be
selected.
(lSelect) if .TRUE. will set the Rdd selected.
Returns:
A character string with the name of the Rdd selected by the user.
Description:
DC_RDDSEL() will pop-up a list of all database drivers that
have been linked into the application for the user to choose an
RDD.
Source/Library:
_DCRDD.PRG/.OBJ, DCLIP.LIB
See Also:
dc_setrdd()
SET RDD
dc_readalt()
Establish alternate usage of Ctrl-END in table of Gets
Syntax:
Arguments:
(lMode) if .TRUE. will Set the alternate mode. The default
is .FALSE.
Returns:
The current mode.
Description:
DC_READALT() provides an alternate usage of K_CTRL_END and
K_CTRL_W in a table of GETS when using DC_READMODAL().
This function is used to set the Read mode to cause K_CTRL_END
and K_CTRL_W to go to the last GET. The default condition is
that K_CTRL_END and K_CTRL_W will terminate the read.
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readnav()
dc_readapick()
Pops up array pick-list if GET not valid or double-clicked
Syntax:
Arguments:
(xGetValue) is the current value in the GET variable.
(aPickList) is an array of valid values for (getvar).
If this is a single-dimensional array, then the array
items will be displayed in the pick-list. If it's a
multi-dimensional array, then the first element of each
item will be used for the validation, the second element
of each item will be displayed in the pick-list, and the
third (optional) element is a HELP CODE (character string)
which will be passed on to the DC_HelpF1() function to
display context-specific help if the F1 key is pressed on
a selected item in the picklist. (aPickList) may also be
passed as a code-block that returns an array when evaluated.
(aPickList) may be passed as an array of arrays with a
pointer to which sub-array to use as the pick-list via
(nSubList). See below.
(nStRow), (nStCol), (nEnRow), (nEnCol) are the screen
coordinates to display the picklist. If no coordinates
are passed, then the pick-list will be displayed just
to the right of the current GET location.
(lAccept) if .TRUE. will exit the GET if the operator
selects an item from the pick-list. If .FALSE. (default),
then the value will be returned into the GET and the cursor
will remain in the GET.
(lScanExact) if .TRUE. (default) will scan the (aValues)
array for an "exact" match to the passed value. IF .FALSE.,
then the standard string-match method will be used.
(lStringList) if .TRUE. will assume that the value in the
GET is a list of characters, and the (aValues) array
contains a single character for each item. This method is
used to pick one or more items from the the list and add
the item to the value in the GET. If .FALSE. (default)
then the value of the GET will be replaced by the selected
item.
(nSubList) is used to choose a sub-array from (aValues) if
(aValues) is an array of arrays rather than a single-
dimensional array. If (nSubList) is a 0 or is not passed
then it is assumed that (aValues) is a single-dimensional
array.
(lAddToGet) if .TRUE. will append the selected value to the
current value(s) in the GET. If .FALSE. (default), then
the GET contents will be replaced by the selected value.
Returns:
A .TRUE. if the value entered for (getvar) is valid,
.FALSE. otherwise.
Description:
DC_READAPICK() is used to validate the value in a GET based
on a passed array and pop-up a pick-list if the input is
not valid. DC_READAPICK() should be used as a VALID
function in a GET statement. The pick-list will be displayed
whenever the input is not valid or when the mouse is double-
clicked.
Notes:
This function will work properly only when used with
DC_READMODAL().
If you want an array picklist with multiple columns
use DC_READDPICK().
Examples:
-- Example 1 --
// Let's say that the only valid entries in the field
// "nTimeIncr" are 5, 10, 15, 30, and 60. You would use
// DC_READAPICK() as follows:
GetList := {}
@ 10,10 SAY 'Enter Time Increment ' GET nTimeIncr VALID ;
DC_READAPICK( nTimeIncr, { 5,10,15,30,60 } ) PICKLIST
dc_ReadModal( GetList )
-- Example 2 --
// Let's say that the only valid entries in the field
// "nWeek" are 1,2 or 3. You would use DC_READAPICK() as
// follows:
GetList := {}
@ 10,10 SAY 'Enter Week ' GET nWeek VALID ;
DC_READAPICK( nWeek, ;
{ { 1,'First' },{ 2,'Second' },{ 3,'Third' } } ) ;
PICKLIST
dc_ReadModal( GetList )
-- Example 3 --
// You want to choose from a list of single-character
// options and add each selected option to the GET.
GetList := {}
@ 10,10 SAY 'Enter Option List ' GET cList VALID ;
DC_READAPICK( cList, ;
{ { 'P','Protect' }, {'L','Log'},{'S','Save'} }, ;
10,40,20,75,,,.t. )
Source/Library:
_DCACHOI.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readdpick()
dc_achoice()
dc_dbchoice()
dc_readbox()
Create a modal dialog box and Mouse Buttons for DC_ReadModal()
Syntax:
Arguments:
(nStrow), (nStcol), (nEnrow), (nEncol) are the active
coordinates of the modal dialogue box.
(cTitle) is the title of the box.
@(aActiveArea) is the name of the variable to store the array
created by DC_READBOX() which will later be passed to
DC_ReadModal().
(aHotKeys) is a multi-dimensional array of hotkeys. The
information in this array will be used to paint mouse buttons
on the perimeter of the box to pass-on a portion of this
information to DC_ReadModal(). If no array is passed then the
following default array will be created:
(aHotKeys[1]) :
{ {'[þ]',K_ESC,(nStCol)+2 } }
(aHotKeys[2]) :
{ {'[F10:Save]',K_F10,(nStCol)+2} ;
{'[ESC:Cancel]',K_ESC,(nStCol)+15},;
{'[F1:Help]',K_F1,(nStCol)+30} }
(aHotKeys[1]) is an array of buttons to place on the top of
the dialogue box.
(aHotKeys[2]) is an array of buttons to place on the bottom of
the dialogue box.
Returns:
A character string that is a "composite" of the coordinates,
colors, etc. to be used later to restore the screen with
DC_IMPL().
Description:
DC_READBOX() which is used to explode an area of the screen
and create an array of mouse buttons to draw on the perimeter
of the box and to pass on to DC_ReadModal(). This functions
works identical to DC_EXPL() except it also adds the following
mouse buttons of the perimeter of the box:
[þ] - Stuffs ESCape (27 )key
[F10:Save] - Stuffs F-10 (-9) key
[ESC:Cancel] - Stuffs ESCape (27) key
[F1:Help] - Stuffs F-1 (28) key
DC_READBOX() also stores the coordinates of the box interior
to a static array which is later monitored by DC_GETDEVOUT(),
DC_GETDISPLAY(), and DC_READMODAL() to prevent @SAY..GETS
from being displayed outside the window region. Such GETS
will be added to the Get List but will only be accessible
when the Get List is "scrolled" by bumping against the
scroll boundaries with a cursor key.
Examples:
LOCAL GetList := {}, aReadArea, cSaveScreen
cSaveScreen := DC_READBOX( 10, 10, 19, 70,, @aReadArea )
@ 12,15 say 'Customer Number ' GET cust_nmbr
@ 13,15 say ' Customer Name ' GET cust_name
@ 14,15 say ' Street ' GET street
@ 15,15 say ' City ' GET city
@ 16,15 say ' State ' GET state
@ 17,15 say ' Zip ' GET zip
DC_ReadModal( GetList, 2, aReadArea )
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readcapfirst()
Capitalize all first letters of all words in all GETs
Syntax:
Arguments:
(lMode) if .TRUE. will set the "CapFirst" flag. From then
on all GETs read by DC_READMODAL() will automatically
capitalize the first letter of each new word when typed
into a GET. If .FALSE. will reset the "CapFirst" flag.
Returns:
A logical value whic is the last setting of the "CapFirst"
flag.
Description:
DC_READCAPFIRST() is used to automatically capitalize the
first letter of each new word when typed into all GETs.
If you wish to CapFirst only a "specified" GET, then use
the CAPFIRST command in the @SAY..GET command line and
the #include "dcget.ch" statement.
Examples:
-- Example 1 --
local cCustName, cAddress, GetList:={}
store cust_name to cCustName
store address to cAddress
DC_READCAPFIRST(.t.)
@ 10,10 say 'Customer Name ' get cCustName
@ 11,10 say 'Street Address ' get cAddress
dc_readmodal( GetList )
DC_READCAPFIRST(.f.)
-- Example 2 --
local cCustName, cAddress, GetList:={}
store cust_name to cCustName
store address to cAddress
@ 01,10 say 'Customer Name ' get cCustName CAPFIRST
@ 11,10 say 'Street Address ' get cAddress
dc_readmodal( GetList )
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readclick()
Evaluate code-block if mouse is double-clicked in a GET
Syntax:
Arguments:
(xValue) is the value of the GET memory variable. If this
is passed as a NIL, then the oGET:VarGet() value will be
used.
(bEval) is the code block to evaluate if the mouse is
double-clicked.
(lEnter) if .TRUE. will evaluate the code-block if the
ENTER key is hit or the mouse is double-clicked. If
.FALSE. (default) then only a double-click will invoke
the evaluation.
(lNoEmpty) if .TRUE. will evaluate the code-block if
the (xValue) is empty even if the mouse in not double-
clicked. The default is .FALSE.
Returns:
If the mouse is double-clicked the returns the value
returned by the evaluated code-block, otherwise returns
.TRUE.
Description:
DC_READCLICK() is designed to be used in a the VALID clause
of a GET statement. This will evaluate a code block only if
the mouse left button is double-clicked or the right button
is clicked on the specified GET or if (optionally) the last
key hit is the (ENTER) key or if (optionally) the value of
the GET is empty.
Notes:
This function must be used with DC_READMODAL().
Examples:
// In this example, the calculator will pop-up and return
// the accumulator in the (nTax) variable if the mouse
// is double-clicked on the (nTax) get or the calendar
// will pop-up and return the selected date if the mouse
// is double-clicked on the (dDate) get.
@ 12,10 say 'Sales Tax' get nTax ;
VALID DC_READCLICK( nTax, { |n| dc_popcalc(n)} )
@ 13,10 say ' Date' get dDate ;
VALID DC_READCLICK( dDate, { |d| dc_popdate(d)} )
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readcolor()
A function for validating color strings in a GET
Syntax:
Arguments:
(cColor) is the name of the GET variable.
(nDisplayRow) is the start display row to display the color
pick-list.
(lEmptyOK) if .TRUE. will allow (cColor) to be empty. If
.FALSE. (default) then if (cColor) is empty the color
pick-list will be automatically displayed.
Returns:
A logical .TRUE. if the color string entered is valid or
the operator picked a color from the pick-list.
Description:
DC_READCOLOR() is used to validate a color-string value in a
GET. DC_READCOLOR() should be used as a VALID function in a
GET statement. The pick-list will be displayed whenever
the input is not valid or when the mouse is double-clicked.
Notes:
This function will work properly only when used with
DC_READMODAL().
Examples:
@ 7,12 SAY 'Enter a color string' GET cColor ;
VALID DC_ReadColor( @cColor, 15 ) PICKLIST
Source/Library:
_DCCLRSL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readcua()
Set CUA-Compliance for Navigating Gets
Syntax:
Arguments:
(lNewCUAMode) if .TRUE. will set the CUA-compliant mode ON,
if .FALSE. will set the CUA-compliant mode OFF, and if not
passed will not affect the current setting.
Returns:
A logical value equivalent to the previous setting.
Description:
DC_READCUA() is used to set the CUA-Compliant mode for
terminating a table of GETS. The normal termination method
is CTRL-W or CTRL-END, whereas the CUA-Compliant method of
terminating a table of GETS is the ENTER key. In both modes
the TAB key will move to the next get and the SHIFT-TAB key
will move to the previous get.
CUA-Compliant mode is consistent with IBM and Windows software
systems.
Examples:
/* -- Set CUA-compliance ON -- */
DC_READCUA(.t.)
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readalt()
dc_readnav()
dc_readcut()
Establish the keys to use for cutting and pasting Gets
Syntax:
Arguments:
(aKeys) is an array of 2 elements.
Element Type Description Default
------- ---- ----------- -----------
1 N Cut key 290 (Alt-G)
2 N Paste key 275 (Alt-R)
Returns:
A 2-element array containing the current keys.
Description:
DC_READCUT() is used to establish the keyboard keys to use
for cutting and pasting between GETS when using DC_READMODAL()
function.
The default key for CUT is ALT-G (grab).
The default key for PASTE is ALT-R (replace).
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readdpick()
Pops up database or array pick-list in a GET
Syntax:
Arguments:
(xValue) is the name of the GET memory variable.
(cAlias) is the alias of the work area to select for the
pick list. This parameter is not needed if (aData) is passed.
(aOptions) is an array of options about the picklist box.
This array must conform to the same requirements as the
(aOptions) array for DC_DBCHCREATE().
(aColumns) is an array of columns to display in the picklist
box. This array must conform to the same requirements as the
(aColumns) array for DC_DBCHCREATE().
(bFieldBlock) is a code-block to evaluate after the user
chooses the record from the pick-list. The evaluated output
will be stored in (xValue).
(aData) is the name of a multi-dimensional array containing
the pick-list data. If this parameter is not passed, then the
pick-list data will come from the database selected by (cAlias).
(bPreBlock) is a code block to evaluate before popping up the
pick-list. (xValue) is passed as a parameter to the code
block. The code block may return a numeric value to control
the continuing behavior of the function. If the code block
returns a numerical 1, then the picklist will not be displayed
and DC_ReadDPick() will return a logical .FALSE. If the code
block returns a numerical 2, then the picklist will not be
displayed and DC_ReadDPick() will return a logical .TRUE. If
the codeblock returns any other value, the picklist will be
displayed.
(bPostBlock) is a code block to evaluate after the pick-list
has been displayed and the user selects a record or presses
ESCAPE. (xValue) is passed as a parameter to the code
block. The code block may return a numeric value to control
the return value of the function. If the code block returns a
numerical 1, then DC_ReadDPick() will return a logical .FALSE.
If the code block returns a numerical 2, then DC_ReadDPick()
will return a logical .TRUE. If the codeblock returns a logical
value then the logical value will be returned. If the codeblock
returns any other value, a logical .TRUE. will be returned.
(bPreBlock) and (bPostBlock) are optional parameters and may
be used for such functions as opening and closing the database,
setting filters and or indexes, etc. in the event that the
database is not already open or the database conditions are
unknown.
(lSeek) if .TRUE. (default) will seek to the value passed as
(xSeekValue) if not empty, otherwise will seek to the value
passed as (xValue). A .TRUE. will be returned if found,
otherwise a database pick-list will be displayed.
(lEmptyOK) if .TRUE. will return a .TRUE. if (xValue) is empty
and (lSeek) is .FALSE. The pick-list will not be displayed.
(cFilter) is a filter string to impose upon the database before
seeking or displaying records. Any old filter will be restored
before returning.
(nSeekIndex) is the number (numeric) or tag-name (character) of
the index to select before seeking the record when (lSeek) is
.TRUE. If this parameter is not passed, then the currently
selected index will be used. The currently selected index will
be restored upon return.
(xSeekValue) if not empty, will be used to perform the seek when
(lSeek) is .TRUE., otherwise (xValue) will be used.
Returns:
A logical .TRUE. if the operator clicks on a different GET
or if the operator chooses and item from the pick-list. A
logical .FALSE. if the operator presses the ESCAPE key.
Description:
DC_READDPICK() will pop-up a database pick-list or a multi-
dimensional array pick-list if the mouse is double-clicked
on a GET and return data from the selected record or array
element into the GET. DC_READDPICK() should be used as a
VALID function in a GET statement.
Notes:
This function will work properly only when used with
DC_READMODAL().
Examples:
-- Example 1 --
// In this example a GET table asks the operator for a Customer
// Number. If the operator double-clicks on the GET, the
// CUSTOMER database will be selected, a pick-list will pop-up
// displaying the CUSTOMER NUMBER and CUSTOMER NAME. The
// CUSTOMER NUMBER of the selected record will be returned into
// the GET variable.
local cCustomer := SPACE(10), GetList := {}
@ 10,10 say 'Enter Customer Number ' GET cCustNmbr ;
VALID DC_READDPICK( cCustNmbr, 'CUSTOMER', { 5,20,20,75 },;
{ {{||cust_nmbr},'Number' },;
{{||cust_name},'Customer Name' } },;
{||PAD(cust_nmbr,10)} )
dc_readmodal(GetList)
-- Example 2 --
// In this example a GET table asks the operator for a File
// Name. If the operator double-clicks on the GET, the
// Directory() function will be used to create an array of
// file names which will be displayed in the pick-list. The
// selected file will be returned into the GET variable.
local cFileName := space(50), GetList := {}
@ 10,10 say 'Enter File Name' get cFileName ;
VALID DC_READDPICK( cFileName,, { 5,20,20,75 },;
{ { 1,'File Name',15 }, { 2,'Size',8 }, { 3, 'Date',8 }},;
{|a,n|a:=Directory(),n:=dc_arrayrec(),PAD(a[n,1],50)},;
Directory() )
dc_readmodal(GetList)
Source/Library:
_DCDBCHO.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readapick()
dc_dbchoice()
dc_readempty()
Validate that a GET is not empty or display message
Syntax:
Arguments:
(xMemVar) is the memvar to validate.
(cLine1) thru (cLineN) is an array of character strings. This is
the message to display if the field is empty.
Returns:
Returns .TRUE. if (xMemVar) is not empty, otherwise will
display message, wait for a key hit or mouse-click, then return
.FALSE.
Description:
DC_READEMPTY() is used as a VALID function in a GET statement to
validate that a field is not empty. If the field is empty, a
passed message will be displayed.
Examples:
@ 10,10 say 'Enter Customer Name ' GET cCustName ;
VALID DC_READEMPTY( cCustName ,;
{ "Must enter a Customer Name" } )
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_reader()
A Replacement for GetReader() that works with mouse
Syntax:
Arguments:
(oGet) is the Get object that is currently in focus.
(aGetList) is the Get List array.
Returns:
nil
Description:
DC_READER() is a direct replacement for the Clipper
GetReader() function and works identical except that it
recognizes mouse events and will automatically move the
cursor up and down through the gets if the mouse is clicked
within an active get.
DC_READER() is the default reader for DC_READMODAL(). This
function may be "inherited" by a custom reader posted as
the oGet:reader code block. A custom reader function can
perform special actions, such as displaying messages, and
then call DC_READER() to continue the "moused" key read
action.
Notes:
DC_READER() should be used only when using DC_READMODAL().
Examples:
LOCAL GetList := {}
@ 13,15 say ' Customer Name ' GET cust_name
@ 14,15 say ' Street ' GET street
@ 15,15 say ' City ' GET city
@ 16,15 say ' State ' GET state
@ 17,15 say ' Zip ' GET zip
oGet := GetList[5]
oGet:reader := {|oGet| MyReader( oGet, GetList )}
dc_readmodal( GetList )
Return nil
// ----------------- //
STATIC FUNCTION MyReader ( oGet, GetList )
@ 24,0 SAY 'Enter a Valid Zip Code'
DC_READER( oGet, GetList )
@ 24,0 clear
Return nil
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readhelp()
Post a code-block for F1 help when using DC_ReadModal()
Syntax:
Arguments:
(bHelp) is a code block that is used to call a HELP procedure
when F1 is pressed or the mouse is clicked on HELP.
Returns:
The last posted code block.
Description:
DC_READHELP() is used to establish the help procedure to
call when the F1 key is pressed or the mouse is clicked on
the HELP button that has been displayed when using
DC_ReadModal(). If no code block has been posted and the
function DC_HELPF1() has been linked into the application
then this will automatically default to calling DC_HELPF1().
Examples:
LOCAL bHelp, bSaveHelp, aReadArea, GetList := {}
LOCAL cFileName := SPACE(40), cText := SPACE(30)
bHelp := { |p,l,v| MyF1Help(p,l,v) }
bSaveHelp := DC_READHELP( bHelp )
DC_ReadBox( 11,10,17,70,,@aReadArea)
@ 13,12 SAY ' File Name' GET cFileName
@ 15,12 SAY 'Enter Text' GET cText
DC_ReadModal( GetList,,aReadArea )
DC_READHELP( bSaveHelp )
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_helpf1()
dc_readhelp()
Toggle the "F1=HELP" message on dCLIP dialog screens.
Syntax:
Arguments:
(lMode) if .TRUE. will Set the alternate mode. The default
is .FALSE.
Returns:
The current mode.
Description:
Some dCLIP users don't want the F1=HELP on Dialog Boxes. Place a
call in the start of oyur application to DC_READHELP(.f.).
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readbox()
dc_readincr()
A "VALID" function for incrementing a GET value with the mous
Syntax:
Arguments:
@(getvar) is the name of the GET variable.
(aValues) is an array of valid values for (getvar).
Returns:
.TRUE.
Description:
DC_READINCR() is used to increment the value in a GET based
on a passed array. DC_READINCR() should be used in a VALID
statement to increment through an array of values when the
mouse is double-clicked or the right mouse button is pressed.
Notes:
This function will work properly only when used with
DC_READMODAL().
Examples:
// Let's say that the only valid entries in the field
// "nTimeIncr" are 5, 10, 15, 30, and 60. You would use
// DC_READINCR() as follows:
GetList := {}
@ 10,10 SAY 'Enter Time Increment ' GET nTimeIncr VALID ;
DC_READINCR( @nTimeIncr, { 5,10,15,30,60 } ) .AND. ;
' '+STR(nTimeIncr,2)+' ' $ ' 5 10 15 30 60 ' PICKLIST
dc_readmodal( Getlist )
// If the current value of nTimeIncr is 15, then double-
// clicking on the get will change it to 30.
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readkill()
Return, and/or set, whether current READ should be exited
Syntax:
Arguments:
(lReadKill) sets the DC_READKILL() flag. A value of true (.T.)
indicates that the current read should be terminated, and a value
of false (.F.) indicates that it should not.
Returns:
NIL
Description:
DC_READKILL() is a Get system function that lets you control
whether or not to terminate the current READ.
Unless directly manipulated, DC_READKILL() returns true (.T.)
after you issue a CLEAR GETS, the current READ and otherwise
returns false (.F.).
By accessing the function directly, however, you can control the
DC_READKILL() flag with its function argument and use it to create
new READ Layers.
Notes:
DC_READKILL() works with DC_READMODAL() in the same way that
Clipper's READKILL() works with READMODAL().
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readmemo()
Insert a memo editor into a table of GETS
Syntax:
Arguments:
@(cMemo) is the memo field to edit or view. If this argument
is a NIL, then (cMemVar) must contain the name of a PRIVATE or
PUBLIC memvar with the contents of the memo.
(nStrow), (nStcol), (nEnrow), (nEnCol) are the screen
coordinates.
(cTitle) is the title to put on the memo box.
(lEnter) if .TRUE. will display the memo only if the ENTER key
was pressed in the GET or the mouse was double-clicked,
otherwise the memo will be displayed when (1) entering the get
if using the WHEN clause or (2) leaving the get if using the
VALID clause.
(lEdit) if .TRUE. will enter "edit" mode, otherwise "view"
mode will be active and "edit" will be an option on the memo
menu.
(lProtect) will allow the user to view or print the memo only.
(nExitState) is a number (from GETEXIT.CH) to determine where
to navigate in the get list after exiting the memo editor.
GE_NOEXIT is default.
Returns:
.TRUE.
Description:
DC_READMEMO() is used to place memos into tables of GETs.
DC_READMEMO() should be used as a WHEN or VALID function in
a GET statement (depending on how you want it to function).
Depending on the mode selected, the memo will be displayed
and/or edited whenever the memo GET is entered or when the
ENTER key is hit or the mouse is double-clicked.
Notes:
This function will work properly only when used with
DC_READMODAL().
See DC_MEMOBASE() for information on the how to use the
memo editor.
Examples:
cApptMemo := tcappt-)cal_memo
cApptAgenda := tcappt-)agen_memo
cGetMemo := 'MEMO'
cGetAgenda := 'MEMO'
@ 10,10 SAY ' Appointment Memo' GET cGetMemo VALID ;
DC_READMEMO( @cApptMemo, 12, 10, 23, 70, 'Appointment Memo',;
.t., .f., .f. )
@ 11,10 SAY 'Appointment Agenda' GET cGetAgenda VALID ;
DC_READMEMO( @cApptAgenda, 12, 10, 23, 70, 'Agenda Memo',;
.t., .f., .f. )
dc_readmodal( GetList )
Source/Library:
_DCMEMO.PRG/.OBJ, DCLIP.LIB
See Also:
dc_memobase()
dc_readmodal()
dc_readmodal()
A moused replacement for ReadModal()
Syntax:
Arguments:
(aGetList) is an array containing a list of Get objects to
edit.
(nPos) is the number of the GET to place into focus.
If no parameter is passed then GET #1 will be in focus.
(aActiveArea) is an array of 4 elements:
Element Type Description
------- ---- -----------------------------------------
[1] N Start Row
[2] N Start Column
[3] N End Row
[4] N End Column
[5] A Mouse buttons
(See DC_MOUSEKEY() for specification)
If no array is passed, then if the mouse is clicked outside
any active GETs, it will do nothing. If an array is passed,
an the mouse is clicked outside the array coordinates, the
READ will be terminated exactly the same as hitting the
CTRL-W key.
(lConfirm) if .TRUE. will display a confirmation picklist, if
.FALSE. (default) will exit normally.
(nConfRow) - If a value is passed the confirmation box
will start at the row number of the passed value, otherwise
it will be centered on the screen.
(lNoUpdateEsc) - If .TRUE., the mouse is clicked outside the
active area, and no gets were updated, then Lastkey() will
return K_ESC. If .FALSE. (default), the confirmation box will
be displayed.
(lProtect) - If .TRUE. the user will be allowed to navigate
thru the GET table, but will not be allowed to change any
data in the active gets. If .FALSE. (default), then the Get
list will behave normally.
(aMsg) - This is an optional array of 5 parameters
defining the location of the screen to place messages defined
by the MESSAGE command line parameter in the @SAY..GET command.
Elements 1-4 are the screen coordinates ( nStRow, nStCol,
nEnRow, nEnCol respectively ). Element 5 is a string defining
the color of the message window.
(bCustomKey) - This is a code block which will be evaluated
in the "Apply Key" sub-function of DC_ReadModal(). This routine
checks which key has been pressed and sets the EXITSTATE based
on the key pressed. The default action for keys is the same as
the standard Clipper GET system. You can modify the action for
specified keys by adding your own CASE statements in a function
placed into the (bCustomKey) code block. Three parameters are
passed to your custom function:
1. The Inkey() value of the key pressed.
2. The Get Object that is in focus.
3. The GetList Object.
The (bCustomKey) code-block must return a LOGICAL .TRUE. if the
custom action was accomplished, .FALSE. otherwise.
(aCustomKey) is an array of INKEY values and code blocks. If
any key is pressed that matches an INKEY value in the array,
the associated code-block will be evaluated.
Element Type Description
------- ---- ------------------------
[1] N INKEY value
[2] B Code block to evaluate when (INKEY) is pressed.
(lViewEdit) if .TRUE. will place DC_ReadModal() in the VIEW/EDIT
toggle mode. In this mode, the GETS start out in VIEW mode. In
VIEW mode the GETS may be navigated in the normal method, but
there will be no cursor displayed and pressing data entry keys
will not cause the GETS to be updated. When the (ENTER) key is
pressed the EDIT mode is enabled at the currently selected GET
and the cursor is displayed. Pressing (ESCAPE) will exit EDIT
mode and reestablish VIEW mode. If this parameter is not passed
or is passed as a .FALSE, then normal editing will be enabled.
(lMouXWrite) if .TRUE. is equivalent to pressing the (CTRL-END)
or (F10) key to save the GETS whenever the mouse is clicked
outside the area established by the (aActiveArea) array. If
this parameter is not passed or is passed as a .FALSE., then
clicking the mouse outside the (aActiveArea) region is
equivalent to pressing the (ESCAPE) key.
(lMouRele) if .TRUE. (default) will require that the mouse
button be released and pressed again before it will navigate
to the clicked-on GET. If .FALSE. and the mouse button is
pressed on a GET, the clicked-on GET will immediately be
placed into focus.
(lNoHelp) if .TRUE. will disable the code block that calls
DC_HELPF1() when the F1 key is pressed. The default is .FALSE.
Use this parameter if the F1 key has already been set to a
different procedure.
DC_READMODAL() also supports additional command line parameters
which may be added to the end of your @ SAY...GET command line.
(These options require #include 'DCGET.CH' in your source code):
FORCEVALID
This option will require that the VALID statement in the
GET be evaluated before the Get List can be exited, even if
the GET is never entered by the operator. For example, if you
have a GET that is not allowed to be empty, use this parameter
in conjuction with DC_READEMPTY().
PICKLIST
This option is used to paint a "down arrow" mouse button at
the end of the GET variable on the screen which informs the
operator that an additional picklist will pop-up if the
operator single-clicks on the arrow or double-clicks within
the GET area or if the operator presses the CTRL-J or
CTRL-ENTER key while in the GET area.
DOUBLEPICK
This option is used to paint a "down arrow" and "up arrow"
mouse button at the end of the GET variable on the screen
which informs the operator that clicking on the down arrow
will decrease the value in the GET by the increment value
and clicking on the up arrow will increase the value in the
GET by the increment value. This option was intended to be
used with the DC_ReadIncr() function in the VALID statement.
PREEVAL (block)
This option functions similar to the WHEN clause except it
doesn't return a value and the block is evaluated before the
WHEN block.
POSTEVAL (block)
This option functions similar to the VALID clause except
it doesn't return a value and the block is evaluated before
the VALID block.
MESSAGE (aMessage)
This option is used to display a message on the screen
while the get is in focus. (aMessage) may be a character
string or an array of character strings. The message will be
displayed in the coordinates defined by the DC_READMSG()
function, the SET READ MESSAGE TO (parameters) command, or
the (aMessage) parameter passed to DC_ReadModal().
PROTECT
This option will allow the user to enter the GET but not
make any changes. Any attempt to modify the data will cause
a beep.
HIDE
This option will hide all user input in the GET and display
only an empty GET with the exception of an asterisk * at the
cursor position.
CAPFIRST
This parameter will automatically capitalize the first letter
of each word typed into the GET.
APOINTER
Editing an array of GETS that are displayed in a FOR..NEXT or
DO..WHILE loop using an "incremented" or "decremented" pointer
to each array element is not possible unless the value of the
pointer is stored in CARGO. This can be accomplished very
easily by using the APOINTER (nVar) parameter at the end of
your GET statement. See Example 2.
CHECKBOX [MEMVAR] (xMemVar) [DELIMS (cDelims)]
This option is used to define a GET as a "CHECK BOX". A
check box GET is used to toggle a logical variable whenever
the mouse is clicked in the GET or when the cursor is moved
to the GET and the ENTER key is pressed. The (cDelims)
parameter is a character string of 3 characters defining
the delimeter characters to use to frame the check mark and
the character to use to display the check mark when the
check box is toggled to .TRUE. If the DELIMS suboptions is
not used then the default delimeters is "(*)". (xMemVar) is
the logical memory variable that will be toggled when the check
box is toggled.
RADIOGROUP (nGroup) MEMVAR (xMemVar) [DELIMS (cDelims)] ;
VALUE (xValue)
This option is used to define a set of GETs as a "RADIO GROUP".
A Radio Group GET is used to set a variable to a specified
value whenever the mouse is clicked in the GET or when the
cursor is moved to the GET and the ENTER key is pressed.
(nGroup) is the number of the radio group that binds the
separate GET items to a group. The (cDelims) parameter is a
character string of 3 characters defining the delimeter
characters to use to frame the check mark and the character to
use to display the check mark when the radio group item is
selected. If the DELIMS suboptions is not used then the
default delimeters is "(*)". (xMemVar) is the memory variable
that will be updated when the radio group item is selected.
(xValue) is the value that will be stored into (xMemVar) when
the radio group item is selected.
HELPCODE (helpcode)
This option is used to establish which help screen to display.
If F1 or Alt-F1 is pressed while in the GET, the Help Code will be
passed to the Help System. This will override the INPUT VAR,
PROC NAME, and any DC_HELPCODE() and force the dCLIP Help system to
use the code in the GetList.
Returns:
.TRUE. if any gets were updated, .FALSE. otherwise.
Description:
DC_READMODAL() is a direct replacement for the Clipper
ReadModal() function and works identical except that it
recognizes mouse events and will automatically move the
cursor up and down through the gets if the mouse is clicked
within an active get.
DC_READMODAL() also supports extra parameters for
handling mouse-buttons, determining the "active area"
of the screen, etc.
DC_READMODAL() will support scrollable GETS automatically.
GETS can be written anywhere outside the pre-established GET
scroll region yet they will be visible only within the scroll
region. When the cursor is bumped against the scroll
boundaries, the GETS will scroll up/down or left/right. This
technique allows you to design GET screens which are larger
than the physical display size or a designated display window.
DC_READMODAL() makes it possible to edit arrays of GETS that
are written to the screen in a FOR..NEXT loop.
DC_READMODAL() supports additional navigation features to make
it easier to move thru a table of keys via the keyboard.
Alt-UpArrow : Moves to first GET directly above cursor position.
If no GET exists directly above, then moves to
closes GET above cursor position.
Alt-DnArrow : Moves to first GET directly below cursor position.
If no GET exists directly below, then moves to
closest GET below cursor position.
Alt-RtArrow : Moves to first GET directly to the right of the
current GET.
Alt-LtArrow : Moves to first GET directly to the left of the
current GET.
DC_READMODAL() will terminate the GETs by the same method as
ReadModal() unless you have activated CUA-Compliant mode with
DC_READCUA() in which the GETs will be terminated with the
ENTER key.
Notes:
See ReadModal() in the Clipper guides for more information.
Use the function DC_UPDATED() in place of UPDATED() if
you are using DC_READMODAL() in place of READMODAL().
Use the function DC_GETACTIVE() in place of GETACTIVE()
if you are using DC_READMODAL() in place of READMODAL().
Use the function DC_KILLREAD() in place of __KILLREAD()
if you are using DC_READMODAL() in place of READMODAL().
Use the function DC_READBOX() to create a modal dialogue
box and mouse-buttons for DC_READMODAL() and to
establish the SCROLL region for the gets.
Use the function DC_READWINDOW() to establish the SCROLL
region for the gets.
Examples:
-- Example 1 --
/* This example shows how DC_READMODAL() can be used
to support pick-lists a memos */
#include "dcget.ch"
LOCAL GetList := {}, aReadArea, cSaveScreen,;
cMemoGet := 'MEMO'
cSaveScreen := DC_ReadBox( 9, 10, 19, 70,, @aReadArea )
@ 11,15 say 'Enter Memo' GET cMemoGet ;
valid dc_readmemo( @cMemo ) PICKLIST PROTECT
@ 12,15 say 'Customer Number ' GET cust_nmbr ;
valid dc_readempty(cust_nmbr) FORCEVALID
@ 13,15 say ' Customer Name ' GET cust_name
@ 14,15 say ' Street ' GET street
@ 15,15 say ' City ' GET city
@ 16,15 say ' State ' GET state ;
valid dc_readclick( @state, {|d|d:=statelist()} ) ;
PICKLIST
@ 17,15 say ' Zip ' GET zip MESSAGE ;
"Must be at least 5 digits"
DC_READMODAL( GetList,, aReadArea,,,,,,;
{|a,b|CustomKey(a,b)} )
Return nil
/* ----------------- */
STATIC FUNCTION CustomKey ( nInkey, oGet )
DO CASE
/* Change PgDn key default action */
CASE nInkey = K_PGDN
oGet:ExitState := GE_BOTTOM
/* Change PgUp key default action */
CASE nInkey = K_PGUP
oGet:ExitState := GE_TOP
OTHERWISE
RETURN .f.
ENDCASE
RETURN .t.
-- Example 2 --
/* This example demonstrates how DC_READMODAL() can be
used to edit and scroll thru an Array of Field Data */
#include "dcget.ch"
LOCAL GetList := {}, aReadArea, cSaveScrn, aData, i
USE DCPRINT
aData := Array(Fcount())
FOR i := 1 TO LEN( aData )
aData[i] := FieldGet(i)
NEXT
cSaveScrn := DC_ReadBox( 10, 10, 20, 60,, @aReadArea )
FOR i := 1 TO LEN(aData)
@ i,12 SAY PADL(Field(i),10) GET aData[i] APOINTER i
NEXT
DC_READMODAL( GetList,,aReadArea )
DC_Impl( cSaveScrn )
RETURN nil
-- Example 3 --
/* This example demonstrates how DC_READMODAL() can be
used to create CHECK BOXES and RADIO GROUPS */
#include 'dcget.ch'
FUNCTION junk
LOCAL GetList := {}, aCheck := {' ','û',' '}, nLength,;
aRadio := {'*',' ',' ','*',' ',' '}, ;
lAscii := .f., lBackup := .t., lPrinter := .f., ;
aReadArea, cComPort, ;
cSaveScrn := DC_ReadBox( 3,5,21,70,,@aReadArea )
/* -- Paint Check Boxes -- */
@ 5,10 TO 11,35
@ 5,12 SAY ' Check options below '
@ 7,12 SAY 'Convert to ASCII ' GET aCheck[1] CHECKBOX ;
MEMVAR lAscii DELIMS '(û)'
@ 8,12 SAY 'Keep Backup File ' GET aCheck[2] CHECKBOX ;
MEMVAR lBackup DELIMS '(û)'
@ 9,12 SAY ' Copy to Printer ' GET aCheck[3] CHECKBOX ;
MEMVAR lPrinter DELIMS '(û)'
/* -- Paint Radio Group 1 -- */
@ 13,10 TO 19,35
@ 13,12 SAY ' Select Page Length '
@ 15,12 SAY ' 40 Lines ' GET aRadio[1] RADIOGROUP 1 ;
MEMVAR nLength DELIMS '(*)' VALUE 40
@ 16,12 SAY ' 55 Lines ' GET aRadio[2] RADIOGROUP 1 ;
MEMVAR nLength DELIMS '(*)' VALUE 55
@ 17,12 SAY ' 66 Lines ' GET aRadio[3] RADIOGROUP 1 ;
MEMVAR nLength DELIMS '(*)' VALUE 66
/* -- Paint Radio Group 2 -- */
@ 13,40 TO 19,65
@ 13,42 SAY ' Select Com Port '
@ 15,42 SAY ' Com 1 ' GET aRadio[4] RADIOGROUP 2 ;
MEMVAR cComPort DELIMS '(*)' VALUE 'COM1'
@ 16,42 SAY ' Com 2 ' GET aRadio[5] RADIOGROUP 2 ;
MEMVAR cComPort DELIMS '(*)' VALUE 'COM2'
@ 17,42 SAY ' Com 3 ' GET aRadio[6] RADIOGROUP 2 ;
MEMVAR cComPort DELIMS '(*)' VALUE 'COM3'
DC_READMODAL( GetList,,aReadArea )
DC_Impl( cSaveScrn )
RETURN { lAscii, lBackup, lPrinter, nLength, cComport }
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_reader()
dc_readbox()
dc_readnav()
Enable an alternative navigation method for GETS
Syntax:
Arguments:
(lMode) if .TRUE. will set the alternate navigation
method. The default is .FALSE.
Returns:
The current setting.
Description:
DC_READNAV( .t. ), is used to set the alternate navigation
method when using DC_ReadModal(). Normal navigation in
GETS has the DOWN, ENTER and TAB keys moving to the next
get in the Get List and the UP and SHIFT-TAB key moving to
the previous Get in the Get List. In the alternate method
the ENTER key still behaves the same, however the TAB key
will move to the next get to the right of the get in focus
in the same row, the SHIFT-TAB key will move to the next
get to the left of the get in focus in the same row, and
the UP and DOWN keys will move to the closest GET on the
screen that is above or below the get in focus. The
Alternate Navigation mode is also toggled by the ALT-N key.
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readalt()
dc_readcua()
dc_readonly()
Report if current workarea is Read Only
Syntax:
Arguments:
(nArea) is the work area. If no argument is given then the
current work area will be used.
Description:
DC_READONLY() reports whether a database in a designated work
area was opened as READ ONLY or whether the user has READ/WRITE
priveleges.
Examples:
if DC_READONLY()
? 'This database cannot be modified'
else
replace ship_date with date()
endif
Source/Library:
_DCAREA.PRG/.OBJ, DCLIP.LIB
dc_readvar()
Update a check box or Radio Button GET
Syntax:
Arguments:
@(xMemVar) is the value of the memvar to update. If this
parameter is not passed then the name of a PRIVATE or
PUBLIC memvar must be passed as (cMemVar).
(nElement) is used only if (xMemVar) is an array. The
value of this parameter determines which array element to
update.
(xValue) is used only if (xMemVar) or (cMemVar) is a
Radio Button and not a Check Box. This is the value to
stuff into (xMemVar) or &(xMemVar).
(lCheck) if .TRUE. establishes (xMemVar) as a logical Check
box memvar, otherwise it is a Radio Button memvar of any
type.
Returns:
NIL
Description:
DC_READVAR() is a function designed to be used in a code
block that is passed to DC_ADDCARGO() and evaluated when
the mouse is clicked in a Radio Button or Check Box GET.
See the DCGET.CH file for examples of how to use DC_READVAR().
Notes:
This function must be used with DC_READMODAL().
Examples:
See DCGET.CH
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readwindow()
Establish scroll-region for DC_ReadModal() GETS
Syntax:
Arguments:
(aCoord) is an array containing the screen coordinates.
Element Type Description
------- ---- -----------------------------------------
[1] N Start Row
[2] N Start Column
[3] N End Row
[4] N End Column
Returns:
An array containing the previously established screen
coordinates.
Description:
DC_READWINDOW() is used to establish a window area of the
screen to be used by the next call to DC_READMODAL().
DC_READMODAL() will support scrollable GETS automatically.
GETS can be written anywhere outside the pre-established GET
scroll region yet they will be visible only within the scroll
region. When the cursor is bumped against the scroll
boundaries, the GETS will scroll up/down or left/right. This
technique allows you to design GET screens which are larger
than the physical display size or a designated display window.
DC_READWINDOW() stores the coordinates of the screen
to a static array which is later monitored by DC_GETDEVOUT(),
DC_GETDISPLAY(), and DC_READMODAL() to prevent @SAY..GETS
from being displayed outside the window region. Such GETS
will be added to the Get List but will only be accessible
when the Get List is "scrolled" by bumping against the
scroll boundaries with a cursor key.
Notes:
DC_READWINDOW() must be called before displaying any GETS
with the @SAY..GET command.
Examples:
#include "dcget.ch"
LOCAL GetList := {}, aData, i
USE DCPRINT
aData := Array(Fcount())
FOR i := 1 TO LEN( aData )
aData[i] := FieldGet(i)
NEXT
DC_READWINDOW( { 10, 10, 20, 60 } )
FOR i := 1 TO LEN(aData)
@ i,12 SAY PADL(Field(i),10) GET aData[i] APOINTER i
NEXT
DC_ReadModal( GetList,,aReadArea )
RETURN nil
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readbox()
dc_readwrap()
Enable wrapping mode in a table of GETS
Syntax:
Arguments:
(lWrap) if .TRUE. will enable Read Wrap mode. The default is
.FALSE.
Returns:
.TRUE.
Description:
DC_READWRAP() is used to change the behavior of DC_READMODAL().
If (lWrap) is .TRUE. then pressing ENTER or the DOWN ARROW while
in the last GET will "wrap" to the first GET and pressign the
UP ARROW while in the first GET will "wrap" to the last GET.
Notes:
This function will work properly only when used with
DC_READMODAL().
Examples:
// Set Read Wrap mode ON
DC_READWRAP(.t.)
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_recall()
Pop-up user-prompt menu to recall deleted database records
Syntax:
Arguments:
NONE
Returns:
A logical .TRUE. if the recall process is successfully completed.
Description:
DC_RECALL() is a high-level function that provides a
user-interface menu for recalling records in a work area.
DC_RECALL() prompts the user for information about files and
scoping conditions (with pick-list options), then displays a
progress- Odometer during the recalling process followed by the
final tally results.
Examples:
. use invoice
. use invitems new
. set relation to inv_nmbr into invoice
. DC_RECALL()
Source/Library:
_DCDELE.PRG/.OBJ, DCLIP.LIB
See Also:
dc_util()
UTIL
RECALL
dc_reclock()
Lock the current record regardless of Rdd (data-driver)
Syntax:
Arguments:
(nWaitTime) is the number of seconds to wait for the system to
return a lock before returning the status or the error message.
(0 = wait forever).
(lDisplayError) if .true. will display an operator error
message if the record cannot be locked. (default) or if .false.
will not display an error message to the operator.
Returns:
A logical .TRUE. if the record is successfully locked.
Description:
DC_RECLOCK() is used to lock the currently selected record
before attempting to replace field data.
Examples:
if DC_RECLOCK( 5 )
replace cust_nmbr with cCustNmbr
else
break
endif
Source/Library:
_DCLOCK.PRG/.OBJ, DCLIP.LIB
See Also:
dc_addrec()
dc_rectag()
Build or add to a tag array
Syntax:
Arguments:
(lClear) will remove record numbers from the tag array that
meet the specified conditions, otherwise records will be
added.
(aTags) is an existing array of record numbers which will
display the TAG marker in the browse display. If no
argument is given then the public DCTAGS array will be
used.
See the Clipper DBEVAL() function on how to use the (bFor),
(bWhile), (nNext), (nRec), (lRest) parameters.
Returns:
A pointer to an array of tagged numbers.
Description:
DC_RECTAG() is used to add or remove record numbers from
an array of record numbers that can be used with all database
commands for performing database operations on records that
have are "tagged".
DC_RECTAG() will first check for a logical field in the
database named "TAG" and will operate on this field. If this
field does not exist, it will operate on a PUBLIC array named
DCTAGS.
When it is required to set more than 4000 tags on a database
then it is recommended that you add a logical field named TAG
to your database.
Examples:
use customer
dc_rectagclear()
aTags := {}
// tag all records with a balance greater than 0
aTags := DC_RECTAG(.f., aTags, {||balance)0} )
// untag all records in Los Angeles
aTags := DC_RECTAG(.t., aTags, {||zip='90'.or.zip='91'} )
list cust_name for dc_tagged(aTags)
Source/Library:
_DCRTAG.PRG/.OBJ, DCLIP.LIB
See Also:
TAG
dc_tagged()
dc_rectagbrowse()
Pop-up a pick-list of record for tagging and untagging
Syntax:
Arguments:
(afields) is an array of field names to browse. If no
argument is given then all fields will be used.
(aTags) is an existing array of record numbers which will
display the TAG marker in the browse display. If no
argument is given then the public DCTAGS array will be
used.
(aHeadings) is an array of column headings. Array must
have same number of elements as aFields. If not passed
then column headings will be the same as field names.
(aWidths) is an array of column widths - NUMERIC. Array
must have the same number of elements as aFields. If not
passed then column widths will default to length of each
field.
(cTitle) is the title to appear at top of picklist.
Returns:
A pointer to an array of tagged numbers.
Description:
DC_RECTAGBROWSE() is used to add or remove record numbers from
an array of record numbers that can be used with all database
commands for performing database operations on records that
have been previously "tagged". A pick-list of fields and
records based on the current work area is displayed for
the user to tag or untag records using either the SPACE
bar key or the mouse. Use the LEFT mouse button to TAG the
record and the RIGHT mouse button to UNTAG the record after
placing the mouse cursor in the Tag Column.
DC_RECTAGBROWSE() uses the DC_DBCHOICE() pick-list function.
For a more robust BROWSE system that also supports tagging
features, use the standard BROWSE command or DC_BROWSEDB()
function and select option (A) from the Search Options menu.
Examples:
use customer
dc_rectagclear()
aTags := {}
aTags := DC_RECTAGBROWSE({'CUST_NMBR','CUST_NAME'}, aTags )
list cust_name for dc_tagged(aTags)
Source/Library:
_DCDBCHO.PRG/.OBJ, DCLIP.LIB
See Also:
TAG BROWSE
dc_rectag()
dc_tagged()
dc_rectagclear()
Clear all the tags from the tag array
Syntax:
Arguments:
(aTags) is an array of tags. If no array is passed then
the currently selected work area portion of the public
DCTAGS array will be cleared.
Returns:
nil
Description:
DC_RECTAGCLEAR() will clear out all tags in the public DCTAGS
array for the current work area.
Examples:
use customer
dc_rectag(,,{||balance)0})
count to x for dc_tagged()
? x
123
DC_RECTAGCLEAR()
count to x for dc_tagged()
? x
0
Source/Library:
_DCRTAG.PRG/.OBJ, DCLIP.LIB
See Also:
TAG CLEAR ALL
dc_rectag()
dc_tagged()
dc_rectagtoggle()
Toggle the current record between Tagged/UnTagged
Syntax:
Arguments:
(aTags) is an existing array of record numbers which will
display the TAG marker in the browse display. If no
argument is given then the public DCTAGS array will be
used.
Returns:
A logical .T. if the record was added to the array, .F. if
the record was removed from the array.
Description:
DC_RECTAGTOGGLE() will remove the current record number from
the tag array if it is stored or add the current record number
to the tag array if it is not stored.
This is a handy function to use in browse routines where a
keyboard key is used to toggle a record tag.
Examples:
use customer
aTags := {}
go 10
? DC_RECTAGTOGGLE( aTags )
.T.
? DC_RECTAGTOGGLE( aTags )
.F.
Source/Library:
_DCRTAG.PRG/.OBJ, DCLIP.LIB
See Also:
dc_rectag()
dc_tagged()
dc_relarray()
Get an array of child relational info
Syntax:
Arguments:
NONE.
Returns:
A multi-dimensional array containing one sub-array for each
child relation:
Element Type Description
------ ---- ---------------------------------
1 C Alias of child workarea
2 N Number of child workarea
Description:
DC_RELARRAY() will return an array containing the names and
work areas of all children to the currently selected work
area.
Source/Library:
_DCAREA2.PRG, DCLIP.LIB
dc_rename()
Pop-up a user-prompt menu for renaming a file
Syntax:
Arguments:
NONE
Returns:
A logical .TRUE. if a file was renamed, .FALSE. otherwise.
Description:
DC_RENAME() is a high-level function that prompts a user with
menus and pick-lists for renaming any file.
Examples:
@ 12,10 prompt "Copy a File"
@ 13,10 prompt "Erase a File"
@ 14,10 prompt "Rename a File"
menu to nChoice
do case
case nChoice = 1
dc_copyfile()
case nChoice = 2
dc_erase()
case nChoice = 3
DC_RENAME()
endcase
Source/Library:
_DCRENAM.PRG/.OBJ, DCLIP.LIB
See Also:
ASSIST
dc_assist()
dc_replace()
Pop-up a user-prompt menu for replacing database fields
Syntax:
Arguments:
NONE
Returns:
A logical .TRUE. if data was replaced, .FALSE. otherwise.
Description:
DC_REPLACE() is a high-level function that provides a
user-interface menu for replacing data in specified fields in a
work area.
DC_REPLACE() prompts the user for information about files,
fields, and scoping conditions (with pick-list options), allows
the user to build a replacement condition from a pick list of
options, then displays a progress-Odometer during the
replacement process followed by the final results.
Examples:
@ 11,10 prompt "Delete Records"
@ 12,10 prompt "Recall Records"
@ 13,10 prompt "Replace Data by condition"
menu to nChoice
do case
case nChoice = 1
dc_append()
case nChoice = 2
dc_delete()
case nChoice = 3
DC_REPLACE()
endcase
Source/Library:
_DCREPL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_util()
UTIL
REPLACE
dc_report()
A Report and Label Form manager
Syntax:
Arguments:
(lProtect) if .TRUE. will protect the reports from being
modified by the operator. .FALSE. is the default.
Returns:
NIL
Description:
DC_REPORT() will invoke a report form manager that uses a
database to integrate report (*.FRM) and label (*.LBL) files
with work (*.DCW) files to edit and run columnar reports and
continuous labels.
A database named DCRLFRM.DBF is used for the integration. If
this database does not exist it will be created.
Source/Library:
_DCREPRT.PRG/.OBJ, DCLIP.LIB
See Also:
REPORT FORM
dc_frmmodify()
dc_lblmodify()
REPORT
dc_restset()
Restore all Clipper SETs from an array
Syntax:
Arguments:
(aSets) is an array created by DC_SAVESET().
Returns:
nil
Description:
DC_RESTSET() will restore the Clipper SET environment from an
array created by DC_SAVESET(). The Clipper SET environment
consists of 38 variables which are modified with the SET()
function. DC_SAVESET() provides a method of saving an
environment to be restored by DC_RESTSET().
Examples:
aSaveSet := dc_saveset()
set default to \customer\data
set path to \myreport
set printfile to print.txt
use customer
report form custlist
DC_RESTSET( aSetSave )
Source/Library:
_DCSETK.PRG/.OBJ, DCLIP.LIB
See Also:
dc_saveset()
dc_saveset()
Save all Clipper SETs to an array
Syntax:
Arguments:
None
Returns:
An array that contains the contents of the SET environment.
Description:
DC_SAVESET() will save the Clipper SET environment to an array.
The Clipper SET environment consists of 38 variables which are
modified with the SET() function. DC_SAVESET() provides a
method of saving an environment to be restored by DC_RESTSET().
Examples:
aSaveSet := DC_SAVESET()
set default to \customer\data
set path to \myreport
set printfile to print.txt
use customer
report form custlist
dc_restset( aSetSave )
Source/Library:
_DCSETK.PRG/.OBJ, DCLIP.LIB
See Also:
dc_restset()
dc_say()
Perform @..SAYs relative to coordinates in dc_expl() window
Syntax:
Arguments:
(cSaveScreen) is the composite screen data returned by
DC_EXPL().
(nRow) is the relative row position within the window.
(nCol) is the relative column position within the window.
(cText) is the text to display.
Returns:
NIL
Description:
DC_SAY() is used to write text to a window that was created by
DC_EXPL(). This function uses "relative" addressing so the
text written in the window is relative to the starting
coordinates of the window.
Examples:
aText := { "Enter a name to search.",;
"The name must start with",;
"an alphabet character" }
disp_msg( 10,10,15,40,aText )
return
FUNC disp_msg ( nSrow, nScol, nErow, nEcol, aText )
cScreen := dc_expl( nSrow, nScol, nErow, nEcol )
for i := 1 to len(aText)
DC_SAY( i+1, 2, aText[i] )
next
Source/Library:
_DCEXPL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_expl()
dc_saycenter()
Write a string in the center of an area of the screen
Syntax:
Arguments:
(nRow) is the row position of the screen.
(nStCol) is the start column.
(nEnCol) is the end column.
Returns:
NIL
Description:
DC_SAYCENTER() is a handy way to write a string exactly in
the center of a defined area of the screen.
Examples:
dc_expl( 12, 20, 14, 50 )
DC_SAYCENTER( 13, 20, 50, 'Center this' )
Source/Library:
_DCSAY.PRG/.OBJ, DCLIP.LIB
dc_scope()
Pop-up a menu for creating database scoping conditions
Syntax:
Arguments:
(cMessage) is a title which will appear at the top of the box
that is used to enter the scoping conditions.
Returns:
An array of 9 elements:
Element Type Description
-------- ------------ ---------------------------------
[1] Code Block FOR condition Code Block
[2] Code Block WHILE condition Code Block
[3] Numeric Number of Records, NIL if ALL
[4] Numeric Record Number, NIL if ALL
[5] Logical .t. if REST, .f. if ALL
[6] Variable Scope TOP Value
[7] Variable Scope BOTTOM Value
[8] Character FOR condition Expression
[9] Character WHILE condition Expression
Description:
DC_SCOPE() provides a user-menu for selecting scoping
conditions for database operations. DC_SCOPE() prompts the
operator for FOR, WHILE, CURRENT/ALL, RECORD, REST, and
SCOPING conditions which can be simply entered in a set of
input GETs or built from pop-up condition builders and/or
field pick-lists available by hot key.
DC_SCOPE() is returns an array of scoping conditions that can
then be passed to any database function such as DBEVAL(),
_DBAPPEND(), etc.
Notes:
A Scoping Top and Bottom condition will be allowed only if
the current work area is indexed. The default value for
the Scope TOP will be the value returned by DC_SETSCOPE(0)
and the default value for the Scope BOTTOM will be the value
returned bye DC_SETSCOPE(1).
If a Scoping Condition is entered, then the first record
that matches the scope will will be SEEKED and the scoping
condition will be included in the WHILE clause. The actual
TOP and BOTTOM values returned in the array are intended for
reference purposes only.
Examples:
-- Example 1 --
accept "enter database to copy records to" to cToFile
aScope := DC_SCOPE( 'Copying Records' )
__dbCopy( cToFile, , aScope[1], aScope[2], aScope[3],;
aScope[4], aScope[5] )
-- Example 2 --
nSelect := sele()
accept "enter database to append records from" to cFromFile
use (cFromFile)
aScope := DC_SCOPE( 'Appending Records' )
use
sele ( nSelect )
if dc_filock()
__dbApp( cFromFile, , aScope[1], ;
dc_odblock( aScope[2], aScope[1], aScope[3],, ;
"Appended",, nRecords ), ;
aScope[3], aScope[4], aScope[5] )
unlock
endif
Source/Library:
_DCSCOPE.PRG/.OBJ, DCLIP.LIB
See Also:
dc_setscope()
dc_scoperec()
Get the top/bottom record numbers of a "scoped" database
Syntax:
Arguments:
(xTop) is a value that matches the same type as the index
key to set as the top of the database.
(xBottom) is a value that matches the same type as the
index key to set as the bottom of the database.
@(nTopRec) is the memvar to place the number of the top
record.
@(nBottomRec) is the memvar to place the number of the
bottom record.
Returns:
The current record number if it falls within the scoped
area, otherwise returns the top record.
Description:
DC_SCOPEREC() is used to get the top and bottom records of a
database based on a "scoping" value. This function works only
on an "indexed" database where the scope values match the
index key.
Examples:
LOCAL nTop, nBottom
use customer index custname
DC_SCOPEREC( 'C','L', @nTop, @nBottom )
go nTop
? cust_name
Charlie Weaver
go nBottom
? cust_name
Lionel Gooseberry
Source/Library:
_DCAREA2.PRG/.OBJ, DCLIP.LIB
See Also:
dc_setscope()
dc_scrldata()
Display a database vertical scroll bar
Syntax:
Arguments:
(nStartRow) is the start display row.
(nEndRow) is the end display row.
(nColumn) is the display column.
(lDispBar) if .TRUE. (default) will display the bar,
otherwise only the row pointer will be returned.
(xScopeTop) and (xScopeBottom) are optional values to
determine the number of active records for calculating the
position of the scroll bar. This will work only if an index
is selected and the scope values match the current index.
Returns:
The row position of the scroll-bar.
Description:
DC_SCRLDATA() is used to display a vertical scroll bar on
the screen to show the relative position of the current
record pointer within the database.
This function will worked with indexed or non-indexed
databases but not with "filtered" databases. A thumb 'þ'
character is displayed in the scroll bar in the row
position representative of the relative position of the
current record within the database. If the relative
position cannot be calculated then only the background
characters of the scroll bar will be displayed and a '?'
will be displayed at the first row position of the
scroll-bar.
Notes:
If the scroll-bar slows down your system on large
indexed databases, then it can be enabled or disabled
on the fly with DC_SCRLDENABLE().
Examples:
use customers index custname
// display relative position of current record pointer
// for all customers starting with "H" and ending with "R"
DC_SCRLDATA( 0, 24, 79, .t., "H", "R" )
Source/Library:
_DCSCRLD.PRG/.OBJ, DCLIP.LIB
See Also:
dc_scrldmou()
dc_scrldmou()
Return a record pointer from database scroll-bar mouse-click
Syntax:
Arguments:
(nStartRow) is the start display row.
(nEndRow) is the end display row.
(nMouseRow) is clicked row of the mouse.
(xScopeTop) and (xScopeBottom) are optional values to
determine the number of active records for calculating the
position of the scroll bar. This will work only if an index
is selected and the scope values match the index key.
(lPageMode) if .TRUE. (default ) will return a value that
is one page higher than (nCurrVal) if the mouse is clicked
below the current pointer or a value that is one page
lower than the (nCurrVal) if the mouse is clicked above
the current pointer. If (lPageMode) is .FALSE. then the
value returned is a number proportional to the mouse-click
position within the scroll-bar region.
Returns:
A record number to GO TO.
Description:
DC_SCRLDATA() is used to display a vertical scroll bar on
the screen to show the relative position of the current
record pointer within the database.
This function will worked with indexed or non-indexed
databases but not with "filtered" databases. A 'þ'
character is displayed in the scroll bar in the row
position representative of the relative position of the
current record within the database. If the relative
position cannot be calculated then only the background
characters of the scroll bar will be displayed.
Examples:
use customers index custname
// return record pointer based on scroll-bar mouse-click
// for all customers starting with "H" and ending with "R"
dc_mougetpos( @nMouseRow, @nMouseCol )
nRecNo := DC_SCRLDMOU( 0, 24, nMouseRow, "H", "R" )
Source/Library:
_DCSCRLD.PRG/.OBJ, DCLIP.LIB
See Also:
dc_scrldata()
dc_scrlvmou()
dc_scrldthumb()
Enable display of database vertical scroll bar thumb
Syntax:
Arguments:
(lEnable) if .TRUE. will enable the thumb, otherwise it will
be disabled.
Returns:
A logical value equal to the current setting.
Description:
DC_SCRLDTHUMB() is used to enable or disable the display
of the thumb "þ" within the scroll-bar region of the
vertical scroll-bars on database browse windows. This is
a relative position indicator that is calculated on
indexed databases by a special algorithm that can consume
time on large databases and thereby cause "pauses" in the
browse window updates. If these pauses start becoming
noticable or cause unacceptable performance, then it is
recommended that you disable the scroll-bar thumb with
DC_SCRLDTHUMB(.f.) in your source code, SET THUMB OFF
at the dot-prompt or THUMB=OFF in your DCLIP.SYS file.
Examples:
use customers index custname
DC_SCRLDTHUMB( .f. ) // speed up browsing
dc_browsedb()
use testdata index testdata
DC_SCRLDTHUMB( .t. ) // show relative position
dc_browsedb()
Source/Library:
_DCSCRLD.PRG/.OBJ, DCLIP.LIB
See Also:
dc_scrldata()
dc_scrlhbar()
Display a horizontal scroll bar
Syntax:
Arguments:
(nStartCol) is the start display column.
(nEndCol) is the end display column.
(nRow) is the display row.
(nCurVal) is the current value. This could be an array
element.
(nMinVal) is the minimum value. If an array, then this
should be 1 or the minimum selectable value.
(nMaxVal) is the maximum value. If an array, then this
should be the number of items in the array or the maximum
selectable value.
Returns:
The column position of the scroll bar.
Description:
DC_SCRLHBAR() is used to display a horizontal scroll bar
on the screen to show the relative position of an array
pointer within the array or the relative position of a
numeric pointer between minimum and maximum selectable
values.
Examples:
aFields := array(fcount())
aFields( aFields ) // create an array of field names
nPointer := 10
// display scroll bar showing relative position
DC_SCRLHBAR( 0, 79, 24, nPointer, 1, LEN(aFields )
Source/Library:
_DCSCRL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_scrlhmou()
dc_scrlvbar()
dc_scrlhmou()
Return an array pointer from horizontal scroll-bar mouse-click
Syntax:
Arguments:
(nStartCol) is the start display column.
(nEndCol) is the end display column.
(nMouseCol) is the clicked mouse column.
(nMinVal) is the minimum value. If an array, then this
should be 1 or the minimum selectable value.
(nMaxVal) is the maximum value. If an array, then this
should be the number of items in the array or the maximum
selectable value.
(nCurrVal) is the current value. This is needed to
determine the relative position of the mouse with respect
to the current position.
(lIncrMode) if .TRUE. (default )will return a value that is
one number higher than (nCurrVal) if the mouse is clicked
to the right of the current pointer or a value that is one
number lower than the (nCurrVal) if the mouse is clicked
to the left of the current pointer. If (lIncrMode) is
.FALSE. then the value returned is a number proportional
to the mouse-click position within the scroll-bar region.
Returns:
A pointer to an array element.
Description:
DC_SCRLHMOU() is used with a horizontal scroll bar on
the screen to return an array pointer based on the
relative mouse-click position within the scroll bar.
Examples:
aFields := array(fcount())
aFields( aFields ) // create an array of field names
// get an array element based on mouse position
dc_mougetpos( @nMouseRow, @nMouseCol )
nPointer := ;
DC_SCRLHMOU( 0, 79, 24, nMouseCol, 1, LEN(aFields )
? aFields[nPointer]
Source/Library:
_DCSCRL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_scrlhbar()
dc_scrlvbar()
dc_scrlvbar()
Display a vertical scroll bar
Syntax:
Arguments:
(nStartRow) is the start display row.
(nEndRow) is the end display row.
(nColumn) is the display column.
(nCurVal) is the current value. This could be an array
element.
(nMinVal) is the minimum value. If an array, then this
should be 1 or the minimum selectable value.
(nMaxVal) is the maximum value. If an array, then this
should be the number of items in the array or the maximum
selectable value.
Returns:
The row position of the scroll-bar.
Description:
DC_SCRLVBAR() is used to display a vertical scroll bar on
the screen to show the relative position of an array
pointer within the array or the relative position of a
numeric pointer between minimum and maximum selectable
values.
Examples:
aFields := array(fcount())
aFields( aFields ) // create an array of field names
nPointer := 10
// display scroll bar showing relative position
DC_SCRLVBAR( 0, 24, 79, nPointer, 1, LEN(aFields )
Source/Library:
_DCSCRL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_scrlvmou()
dc_scrldmou()
dc_scrlvmou()
Return an array pointer from vertical scroll-bar mouse-click
Syntax:
Arguments:
(nStartRow) is the start display row.
(nEndRow) is the end display row.
(nMouseRow) is the clicked mouse row.
(nMinVal) is the minimum value. If an array, then this
should be 1 or the minimum selectable value.
(nMaxVal) is the maximum value. If an array, then this
should be the number of items in the array or the maximum
selectable value.
(nCurrVal) is the current value. This is needed to
determine the relative position of the mouse with respect
to the current position.
(lPageMode) if .TRUE. (default) will return a value that
is one page higher than (nCurrVal) if the mouse is clicked
below the current pointer or a value that is one page
lower than the (nCurrVal) if the mouse is clicked above
the current pointer. If (lPageMode) is .FALSE. then the
value returned is a number proportional to the mouse-click
position within the scroll-bar region.
Returns:
A pointer to an array element.
Description:
DC_SCRLVMOU() is used with a vertical scroll bar on
the screen to return an array pointer based on the
relative mouse-click position within the scroll bar.
Examples:
aFields := array(fcount())
aFields( aFields ) // create an array of field names
// get an array element based on mouse position
dc_mougetpos( @nMouseRow, @nMouseCol )
nPointer := ;
DC_SCRLVMOU( 0, 24, 79, nMouseRow, 1, LEN(aFields )
? aFields[nPointer]
Source/Library:
_DCSCRL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_scrlvbar()
dc_scrldmou()
dc_scrnedit()
A Screen Designer/Editor
Syntax:
Arguments:
(cScrnGroup) is the name of the screen group in DCSCRN.DBF
to load and edit (up to 8 characters) or (aScrnGroup) is a
Screen Group array. See RETURNS for a specification of this
array. If no parameter is passed, a pick-list of all Screen
Groups in the DCSCRN.DBF will be displayed.
(cCurrScrn) is the image of the current screen area. If
this parameter is not passed, the existing screen will be
captured.
(aScrnCoord) is an optional array of screen coordinates to
establish the working area of the screen. If no array is
passed then the full screen is the default.
Element Type Description
------- ---- --------------------------------------
[1] N Start Row
[2] N Start Column
[3] N End Row
[4] N End Column
[5] N Row Offset
[6] N Column Offset
The first four elements determine the active area of the
screen. The last two elements are used to determine how
much offset to use for displaying the screen objects. The
objects will be displayed relative to the starting screen
coordinates and will be truncated at the ending screen
coordinates.
Returns:
A 2-dimensional array of two sub-arrays.
The first array contains general information about the
screen group.
Element Type Description
------- ---- --------------------------------------
[1] C Screen Group Name (up to 8 characters)
[2] C Screen Group Description
The second array contains one sub-array for each screen
object.
Element Type Description
------- ---- ---------------------------------------
[1] C Reserved
[2] C Screen object description
[3] C Screen object type (1 character)
F - Fill screen area
B - Draw a box
T - Display text
G - Display a normal input GET
C - Check Box GET
R - Radio Button GET
P - Push Button
M - Memo GET
S - Screen Image
E - Explode a Dialog Window
[4] N Page number (1-99)
[5] N Start Row
[6] N Start Column
[7] N End Row
[8] N End Column
[9] C Text (see TYPE above)
F - 1 char for fill screen
B - 8 characters for a box plus 1 fill char
T - Up to 8000 characters for text
S - Screen Image
G/C/M/R - Prompt for GET
[10] C Color String
[11] C Get Variable Name
[12] C Get Option characters
[13] N Radio Group (1-9)
[14] C Get Picture Clause
[15] C Get Valid Clause (expression)
[16] C Get When Clause (expression)
[17] C Get Default Value (expression)
[18] L Is Get Memvar a PUBLIC Memvar?
[19] C Radio Group Memvar Value (expression)
[20] L Screen tag
Description:
DC_SCRNEDIT() is a screen designer/editor that facilitates
the drawing and locating of screen "objects". The objects
are stored to an array and/or the DCSCRN.DBF data-dictionary
file.
Screen objects can be text, fill-areas, boxes, regular
input GETS, radio-buttons or check-boxes.
Notes:
The DCSCRN.DBF database and its associated indexes will
be created by DC_ScrnOpen() if they do not already exist.
Examples:
-- Example 1 --
// Load a screen group from the dictionary and edit it //
DC_SCRNEDIT()
-- Example 2 --
// Edit screen group "MAIN"
DC_SCRNEDIT("MAIN")
-- Example 3 --
// Edit a screen group array and paint the screen //
aScrnGroup := DC_ScrnPick()
aScrnGroup := DC_SCRNEDIT( aScrnGroup )
DC_ScrnPaint( aScrnGroup )
Source/Library:
_DCSCRN.PRG/.OBJ, DCLIP.LIB
See Also:
SCREEN EDIT
dc_scrnload()
Load a Screen Group in the Screen Dictionary to an array
Syntax:
Arguments:
(cScrnGroup) is the name of the screen group in DCSCRN.DBF
to load (up to 8 characters). If no parameter is passed, a
pick-list of all Screen Groups in the DCSCRN.DBF dictionary
will be displayed.
(lSave2Static) if .TRUE. (default) will save the screen to
a static array so the next time it is requested it will
be reloaded from the static array for faster speed. If
.FALSE. then it will not be save to the static array.
Returns:
An 2-dimensional array that conforms to the specification of
the array defined in DC_SCRNEDIT().
Description:
DC_SCRNLOAD() is used to retrieve a screen group from the
DCSCRN.DBF screen dictionary and store it to an array for
editing or painting.
Examples:
aScrnGroup := DC_SCRNLOAD('MYSCREEN')
DC_ScrnPaint( aScrnGroup )
Source/Library:
_DCSCRN.PRG/.OBJ, DCLIP.LIB
See Also:
dc_scrnedit()
dc_scrnpaint()
Paint all screen objects from a screen array
Syntax:
Arguments:
(cScrnGroup) is a screen group array that conforms to the
specifications of the array returned by DC_SCRNEDIT().
(cCurrScrn) is the image of the current screen area. If
this parameter is not passed, the existing screen will be
captured.
(aScrnCoord) is an optional array of screen coordinates to
establish the working area of the screen. If no array is
passed then the full screen is the default.
Element Type Description
------- ---- --------------------------------------
[1] N Start Row
[2] N Start Column
[3] N End Row
[4] N End Column
[5] N Row Offset
[6] N Column Offset
The first four elements determine the active area of the
screen. The last two elements are used to determine how
much offset to use for displaying the screen objects. The
objects will be displayed relative to the starting screen
coordinates and will be truncated at the ending screen
coordinates.
(nScrnPage) is the number of the screen page to display (0-99).
If -1 (default), then all objects in all pages will be displayed.
Screens that have been assigned Page 0 will be displayed along
with the requested screen.
(nElement) is the element number of the screen object to
display. If 0 (default), then all objects will be displayed.
(lScrnImpl) if .TRUE. (default) will implode any screen
window created by a type "E" object after the GETs are
activated and completed with DC_READMODAL().
Returns:
nil
Description:
DC_SCRNPAINT() is used to paint an array of screen objects
from a screen group array. Each object is painted on the
screen in the order that they appear in the array. Objects
in the array are all designated a set of relative
coordinates. An additional array of screen coordinates may
be passed to provide a screen "window" with optional offsets.
Examples:
-- Example 1 --
// Paint the main screen area //
aScrnGroup := DC_ScrnLoad('MAIN')
DC_SCRNPAINT( aScrnGroup )
-- Example 2 --
// Paint page 2 of the Editing screen in a window area //
aScrnGroup := DC_ScrnLoad('EDIT')
DC_SCRNPAINT( aScrnGroup, , { 5,10,20,60,-5,-5} )
-- Example 3 --
See the _DCEDIT.PRG source code for an example of how the
dCLIP database editor uses the screen painter.
Source/Library:
_DCSCRN.PRG/.OBJ, DCLIP.LIB
See Also:
dc_scrnedit()
dc_scrnsave()
A "Night-Sky" or Blank-screen screen Saver
Syntax:
Arguments:
[nTimeOut] is the time (in Seconds) to wait for no keyboard
or mouse activity. If no parameter is passed then the screen
save will start immediately. Note: this time-out is checked
only if you are using dCLIP functions or DC_INKEY() to get a
key. Default is 120 seconds.
DC_SCRNSAVE(-1) will return the current time-out setting
without changing it. DC_SCRNSAVE(0) will disable the screen-
saver.
[nStyle] is the style of screen.
0 - Night sky with blinking stars (default)
1 - Blank screen. Uses INKEY(0) to prevent background
processing in multi-tasking environments.
Returns:
The current screen-saver time-out setting.
Description:
DC_SCRNSAVE() is a "night-sky" style screen-saver that paints
twinkling stars and exploding stars until the mouse is moved
or a key is depressed. DC_SCRNSAVE() is automatically called
by DC_INKEY(). Since all key and mouse activity is monitored
by DC_INKEY() in dCLIP functions, the screen saver will
automatically be invoked after a period of operator inactivity
or system inactivity.
Examples:
-- Example 1 --
// Set DC_INKEY() time-out to 10 seconds
DC_SCRNSAVE( 10 )
-- Example 2 --
// Invoke the screen saver
DC_SCRNSAVE()
Source/Library:
_DCSCRNS.PRG/.OBJ, DCLIP.LIB
See Also:
dc_inkey()
dc_scrnstore()
Save a Screen Group array to the Screen Dictionary file
Syntax:
Arguments:
(aScrnGroup) is an array of screen group objects. This array
must conform to the specifications described in DC_SCRNEDIT().
Returns:
An logical .TRUE. if the array was saved successfully, .FALSE.
otherwise.
Description:
DC_SCRNSTORE() is used to save a screen group array to the
DCSCRN.DBF screen dictionary file. Any existing screen
group with the same name will be overwritten.
Examples:
aScrnGroup := DC_SCRNEDIT('MYSCREEN')
DC_SCRNSTORE( aScrnGroup )
Source/Library:
_DCSCRN.PRG/.OBJ, DCLIP.LIB
See Also:
dc_scrnedit()
dc_search()
Search all fields of a database for a value
Syntax:
Arguments:
(cFileName) is the name of the database to search. If no path
is given then the current SET DEFAULT directory is assumed. If
(cFileName) is "ALL", then all databases that match the
currently selected RDD will be searched.
(cText) is the text to search for. This is a case
non-sensitive search and the first occurrence of the text in
each field will be listed.
(cOutPut) is the name of the output device. If no argument is
given or (cOutPut) is a null "" string then the output will go
to the screen. If (cOutPut) = 'PRN' then the output will go to
the printer, otherwise the output will go to a file named
(cOutPut). If no extension is included then .PRN is assumed.
The file will be created in the SET DEFAULT directory.
Returns:
nil
Description:
DC_SEARCH() is used to search all fields of specified work
areas for matching text and list all occurences of found text.
The output can be sent to the screen, printer or a file and all
occurrences where the text is found will be listed as follows:
File Record Field Text
----------- ------ ------------ ---------------------------
CUSTOMER 123 PHONE 714-555-1212
MAILLIST 23567 PHONE_NUM (619)555-1212
Examples:
// search CUSTOMER.DBF for occurrences of "O'BRIEN"
// and display results on screen
set rdd to 'DBFSIX'
DC_SEARCH( 'CUSTOMER', "O'BRIEN" )
// search CUSTOMER.DB for occurrences of "O'BRIEN"
// and copy results to file OBRIEN.TXT
set rdd to 'PDX'
DC_SEARCH( 'CUSTOMER', "O'BRIEN", "OBRIEN" )
// search all .DBF's for occurences of "CLIPPER"
set rdd to 'DBFNTX'
DC_SEARCH( 'ALL', 'CLIPPER' )
Source/Library:
_DCSRCH.PRG/.OBJ, DCLIP.LIB
See Also:
SEARCH
ASSIST
dc_select()
Pop-up a pick-list of open workarea aliases
Syntax:
Arguments:
(cTitle) is the title to display at the top of the pick-list.
If no parameter is passed, then the default "Choose a Database"
will be displayed.
Returns:
A numeric value which is the work area of the database selected.
Description:
DC_SELECT() pops up a pick-list of currently open database
ALIASes.
Source/Library:
_DCDBSEL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_dbsel()
dc_setarray()
Returns an array with complete SET environment information
Syntax:
Arguments:
NONE
Returns:
A 2-dimensional parallel array with subarray 1 containing the
mnenomic identifier and subarray 2 containing the value of the
environment variable. The first 38 elements are the Clipper
environment and the remaining elements are the dCLIP environment.
For example element [1,1] will return 'EXACT' and [2,1] will
return the logical value for SET EXACT.
Description:
DC_SETARRAY() will return a multi-dimensional array with the
name and current value of each Clipper and dCLIP environment
variable. The Clipper SET environment consists of 38 variables
which are modified with the SET() function or DC_SETT()
function and the dCLIP environment consists of more than 30
variables which are modified with the DC_SETT() function.
DC_SETARRAY() provides an method of reading the entire
environment.
Examples:
-- Example 1 --
aSet := DC_SETARRAY()
? aSet[1,1]
EXACT
? aSet[2,1]
.F.
? aSet[1,39]
RDD
? aSet[2,39]
DBFNTX
-- Example 2 --
// write the contents of the environment to a file
nHandle := fcreate( 'ENVIR.SET' )
aSet := DC_SETARRAY()
for i := 1 to len( aSet[1] )
fwrite( nHandle, pad(aSet[1,i],15) + transform( aSet[2,i], '@' ) )
next
fclose( nHandle )
Source/Library:
_DCSET.PRG/.OBJ, DCLIP.LIB
See Also:
SET
dc_setsave()
dc_setrestore()
dc_setdclip()
Set the directory to use for dCLIP data-dictionary files
Syntax:
Arguments:
(cPathSpec) is any valid directory which may also include a
drive letter. If no parameter is passed, then the value will
not be changed.
Returns:
A character string.
Description:
DC_SETDCLIP() is used to establish the directory which will be
searched for creating dCLIP DC*.DBF databases and indexes.
If the files do not exist in this directory then they will be
created. dCLIP establishes the default for this value in the
following order:
1. Uses the value in any SET DCLIP=(directory) statement in
the DOS environment.
2. Uses the directory in which the .EXEcutable program
resides.
Source/Library:
_DCGETE.PRG/.OBJ, DCLIP.LIB
See Also:
DCLIP =
SET DCLIP
SET DEFAULT
dc_setdefault()
Set the DEFAULT directory the right way
Syntax:
Arguments:
(cPath) is the name of the directory.
Returns:
The new DEFAULT setting.
Description:
DC_SETDEFAULT() is used to set the system DEFAULT directory
without the possibility of creating a runtime error. An
invalid directory cannot be set and the \ is automatically
appended to the end of the DEFAULT setting to insure that
Clipper properly finds the files.
Examples:
#include 'set.ch'
DC_DEFAULT('\DCLIP3\DATA')
? SET(_SET_DEFAULT)
\DCLIP3\DATA\
Source/Library:
_DCPATH.PRG/.OBJ, DCLIP.LIB
See Also:
SET DEFAULT
dc_setdclip()
SET DCLIP
dc_setedit()
Edit the SET environment from a pick-list menu
Syntax:
Arguments:
(cSetName) is the SET environment variable you want to display
as the initial item in the display. If this argument is not
passed, then the start of the display will be the first
variable.
Returns:
NIL
Description:
DC_SETEDIT() is an environment editor that provides a user-
friendly method of viewing the entire Clipper and dCLIP
environment and editing any variable by simply selecting the
desired variable from the pick-list and pressing (ENTER) to
edit.
Examples:
-- Example 1 --
DC_SETEDIT( "DEFAULT" )
-- Example 2 --
DC_SETEDIT()
Source/Library:
_DCSET.PRG/.OBJ, DCLIP.LIB
See Also:
SET
dc_sett()
dc_setfilter()
Set a filter from a Query-by-example-style condition builder
Syntax:
Arguments:
(cFilter) is a string containing the existing filter condition
to build upon. If a null ("") string or no argument is passed
then the query builder will start with a blank slate.
Returns:
A Logical .TRUE. if the filter was set, .FALSE. otherwise.
Description:
DC_SETFILTER() is a front-end call to DC_QUERY(), a complete
menu-driven condition builder system for building complex
expressions from lookup tables of parent and child database
fields and operators.
The condition expressions created by DC_QUERY() is used by
DC_SETFILTER() to set a filter on the database in use.
Examples:
use baseball
set filt to league='NL'
DC_SETFILTER( DbFilter() )
Source/Library:
_DCQUERY.PRG/.OBJ, DCLIP.LIB
See Also:
QUERY
SET FILTER
dc_query()
dc_setindex()
Pop up picklist of available indexes if index file not found
Syntax:
Arguments:
(cFileName) is the name or wildcard of the index file to open.
If a full file name is passed, then DC_SETINDEX() will attempt
to open (cFileName). If the file cannot be found, then the
pick-list will appear. If no argument is passed then a pick-
list of all index files that match the designated RDD will
appear. If a wildcard argument is passed, then all files that
match the wildcard will appear in the pick-list.
(lOpenFile) if .TRUE. (default) will open the index, otherwise
the index will not be opened but the filename will be returned
if the index exists.
Returns:
A character string containing the name of the file used.
Description:
DC_SETINDEX() is a user-friendly front-end to the DbSetIndex()
function. DC_SETINDEX() will pop-up a pick-list of index
files that match the open database if the filename passed
cannot be found.
Examples:
cFileName := space(50)
@ 10,10 say ;
"enter an index to open (leave empty for pick-list)" ;
get cFileName
read
DC_SETINDEX( cFileName )
Source/Library:
_DCUSE.PRG/.OBJ, DCLIP.LIB
See Also:
SET INDEX
dc_setkeyrestore()
Restore a "group" of keys that were save with DC_SETKEYSAVE()
Syntax:
Arguments:
(aKeyNumbers) is an array of INKEY() numbers for the keys
to set.
(bBlock) is the code block to evaluate when any of the
keys are pressed. The array of keys will be reset if this
is a NIL.
Returns:
Nil
Description:
DC_SETKEYRESTORE() is used to restore a set of keys that were
redefined and saved to an array by DC_SETKEYSAVE().
Examples:
local aKeys := { -2, -3, -4, -5, -6, -7 }
local aSaveKeys := dc_setkeysave( aKeys, {||myProc()} )
* Do something
DC_SETKEYRESTORE( aSaveKeys )
return
Source/Library:
_DCSETK.PRG/.OBJ, DCLIP.LIB
See Also:
dc_setkeysave()
SET KEY
dc_setkeysave()
Set a "group" of keys to call the same function/procedure
Syntax:
Arguments:
(aKeyNumbers) is an array of INKEY() numbers for the keys
to set.
(bBlock) is the code block to evaluate when any of the
keys are pressed. The array of keys will be reset if this
is a NIL.
Returns:
An array of keys that is used by DC_SETKEYRESTORE() to restore
the keys to their original value.
Description:
DC_SETKEYSAVE() is a handy function that saves many lines of
code when it is necessary to define a group of keys that
must all call the same function or procedure and then restore
them all to their original value with DC_SETKEYRESTORE().
Examples:
local aKeys := { -2, -3, -4, -5, -6, -7 }
local aSaveKeys := DC_SETKEYSAVE( aKeys, {||myProc()} )
* Do something
dc_setkeyrestore( aSaveKeys )
return
Source/Library:
_DCSETK.PRG/.OBJ, DCLIP.LIB
See Also:
dc_setkeyrestore()
SET KEY
dc_setoptions()
Set indexing options before building a .IDX/.CDX index
Syntax:
Arguments:
(lIsCDX) = .T. if index is a .CDX, .F. if not
(cCDXName) = Name of the .CDX to create or add to
(cCondition) = String containing filter expression
(lDescend) = .T. if index is descending, .F. if not
(bOption) = Code block to execute as OPTION
(nStep) = Number of records to process before each call
to OPTION block
(lUseCurrent) = .T. if index is to be based on current index,
.F. if not.
(lEmpty) = .T. if empty index is to be created.
Returns:
A logical .T.
Description:
DC_SETOPTIONS() is a front-end to the Sx_SetOptions() function
in the DBFSIX driver that installs an Odometer code block to
display a progress indicator when indexing or reindexing using
the DBFSIX driver. All parameters to DC_SETOPTIONS() are
identical to Sx_SetOptions(), therefore it is a direct
replacement.
Source/Library:
_DCSIX.PRG/.OBJ, DCLIP.LIB
See Also:
INDEX
dc_setp()
Send a code sequence to the printer from a pseudo-code
Syntax:
Arguments:
(cPtrCode) = A string of characters which include the
list of code sequences to send to the
printer. See table below.
(lSetPath) = .t. - Set printer path to path designated
in tagged printer record. (default).
.f. - Do not change printer path.
(lCloseFile) = .t. - Close DCPRINT.DBF datafile after
sending codes. (default).
.f. - Leave file open after sending codes.
(lPrintOff) = .f. - Issue SET PRINT ON before sending
codes and SET PRINT OFF after sending
codes. (default)
.t. - Don't change print environment.
(lReturnCodes) = .f. - Send codes to printer.
.t. - Return codes as a string.
(cPtrCode) options:
Code Description
----- ------------------------------------------------
F FORM FEED - Page eject.
P PICA. 10 Characters per inch.
E ELITE. 12 Characters per inch.
C COMPRESSED. 17 Characters per inch.
Q QUALITY. Letter Quality mode
N NORMAL. Data Processing Character Mode
D DOUBLE WIDE ON - Elongated characters
S SET DOUBLE WIDE OFF - Elongated characters off
M MARGINS ON - Set left and right margins
O OFF MARGINS - Turn off left and right margins
A Set UNDERLINE ON
B Set UNDERLINE OFF
G Set BOLD ON
H Set BOLD OFF
U 6 Lines Per Inch
V 8 Lines Per Inch
X Set ITALICIZED ON
Y Set ITALICIZED OFF
I INITIALIZE - Printer initialization code sequence
R RESET - Printer reset to default settings sequence
J Send START SPOOL COMMAND to DOS
K Send END SPOOL COMMAND to DOS
0-9 User-defined psuedo-codes
Returns:
A character string.
Description:
DC_SETP() will convert printer psuedo-codes to the respective
printer code Escape sequences for the selected printer driver
and optional send the Escape codes to the printer or return
them as a string.
Notes:
DC_SETP() requires the use of the DCPRINT.DBF data file which
contains the printer codes for the popular printers.
Before using DC_SETP(), the user should first select and tag a
printer for use with the system. To enter the printer setup
menu use the function: DC_PRINT(). To select a system printer
use the function DC_PRINTSEL().
Examples:
// select a printer driver
nPrinter := dc_printsel()
// Send the escape sequence for Compressed/8 lines per inch
DC_SETP( 'CU', , , , .F. )
report form customer to print
Source/Library:
_DCSETP.PRG/.OBJ, DCLIP.LIB
See Also:
dc_print()
dc_setrdd()
Return the RDD name of an open data file
Syntax:
Arguments:
(nArea) is the work area. If no argument is given, then the
current work area will be used.
Returns:
A character string with the name of the RDD being used. If no
database in opened in the specified work area, then the current
system RDD is returned.
Description:
DC_SETRDD() returns the name of the Replaceable Data Driver
that is being used for the database in a specified work area.
Examples:
select 1
use customer via 'DBFNTX'
? DC_SETRDD()
DBFNTX
select 2
use sales via 'DBFSIX'
? DC_SETRDD()
DBFSIX
select 3
use cust_bor via 'PDX'
? DC_SETRDD()
PDX
select 0
? DC_SETRDD()
DBFNTX
Source/Library:
_DCRDD.PRG/.OBJ, DCLIP.LIB
See Also:
SET RDD
dc_superrdd()
dc_rddsel()
dc_setrestore()
Restore all Clipper/dCLIP SETs from a file or array
Syntax:
Arguments:
The SET environment can be restored either from an array or
file depending on the type of argument passed.
(cFileName) is the name of a SET file that was saved by
DC_SETSAVE( (cFileName ). If no extension is included, then
.DCA is assumed.
(aSets) is an array that was created by DC_SETSAVE().
Returns:
A logical .TRUE. if the SET environment was properly restored.
Description:
DC_SETRESTORE() will restore the SET environment from an array
or file. The Clipper SET environment consists of 38 variables
which are modified with the SET() function or DC_SETT()
function and the dCLIP environment consists of more than 30
variables which are modified with the DC_SETT() function.
DC_SETRESTORE() provides an method of restoring an evironment
saved by DC_SETSAVE().
Examples:
-- Example 1 --
aSaveSet := dc_setsave()
set default to \customer\data
set path to \myreport
set printfile to print.txt
use customer
report form custlist
DC_SETRESTORE( aSetSave )
-- Example 2 --
dc_setsave( 'MYSET' )
set odir to \myapps\obj
set pdir to \myapps\prg
dc_turbedit()
DC_SETRESTORE( 'MYSET' )
Source/Library:
_DCSET.PRG/.OBJ, DCLIP.LIB
dc_setsave()
Save all Clipper/dCLIP SETs to a file or array
Syntax:
Arguments:
(cFileName) is the name of the file to save the SET to. If no
extension is included, then .DCA is assumed.
Returns:
An array that contains the contents of the SET environment.
Description:
DC_SETSAVE() will save the SET environment from to array or
file. The Clipper SET environment consists of 38 variables
which are modified with the SET() function or DC_SETT()
function and the dCLIP environment consists of more than 30
variables which are modified with the DC_SETT() function.
DC_SETSAVE() provides an method of saving an evironment to be
restored by DC_SETRESTORE().
Examples:
-- Example 1 --
aSaveSet := DC_SETSAVE()
set default to \customer\data
set path to \myreport
set printfile to print.txt
use customer
report form custlist
dc_setrestore( aSetSave )
-- Example 2 --
DC_SETSAVE( 'MYSET' )
set odir to \myapps\obj
set pdir to \myapps\prg
dc_turbedit()
dc_setrestore( 'MYSET' )
Source/Library:
_DCSET.PRG/.OBJ, DCLIP.LIB
See Also:
dc_setrestore()
dc_setscope()
Set a scoping value for the current work area
Syntax:
Arguments:
(nWhich) is a number 0 if setting the SCOPE TOP value or a
number 1 if setting the SCOPE BOTTOM value.
(xValue) is the value to set. This should be a value that
matches the current index key. If (xValue) is a NIL then
the current setting will be returned.
Returns:
The current SCOPE value.
Description:
DC_SETSCOPE() is used to set a SCOPE TOP and SCOPE BOTTOM value
for establishing a "scoping range" for a work area. The dCLIP
browsing and editing systems use DC_SETSCOPE() to store the
scoping range when browsing and editing records. When a scoping
range is set, only the records that fall within the range will
appear in the browse or edit screens.
Notes:
DC_SETSCOPE() does not establish the scoping range at the
RDD-layer level, but instead is just a handy way of storing
the SCOPE TOP and SCOPE BOTTOM to be retrieved by programs
that can use this information such as data-entry systems and
browse systems. It does not affect the behavior of the
data-driver nor does it set any filters on the data.
Examples:
use customer
set index to custname
DC_SETSCOPE(0,"HARRIS")
DC_SETSCOPE(1,"HYBRID")
dc_browsedb()
Source/Library:
_DCAREA1.PRG/.OBJ, DCLIP.LIB
See Also:
dc_clrscope()
dc_setstep()
Start or stop source-level debugging mode
Syntax:
Arguments:
(lStepMode) if .TRUE. will start displaying source code on the
first line of code (compiled with debug information) that is
executed. If .FALSE., then step mode will be terminated.
Returns:
A logical value equivalent to the current setting of step mode.
Description:
DC_SETSTEP() is used to start or stop STEP mode (source-level
debugging). STEP mode displays the source code while executing
Clipper-compiled code and allows you to single-step, break on
an expression, procedure/line number, etc. Only code that has
been compiled with debugging information ( /b switch ) will be
displayed in STEP mode. DC_SETSTEP(.t.) is equivalent to the
command SET STEP ON and DC_SETSTEP(.f.) is equivalent to the
command SET STEP OFF.
The DC_STEP() function may be used prior to using DC_SETSTEP()
to establish a specific "break" condition to start the STEP
mode.
Examples:
do while .t.
DC_SETSTEP(.t.) // step through MAINMENU()
code := mainmenu()
DC_SETSTEP(.f.) // set step mode off
do case
case code = 'A'
menu_a()
case code = 'B'
menu_b()
case code = 'C'
menu_c()
endcase
enddo
Source/Library:
_DCDBG.PRG/.OBJ,DCLIP.LIB
See Also:
SET STEP
dc_sett()
Set or Read an environment variable via an identifier
Syntax:
Arguments:
(cSetName) is the identifier code for the SET environment
variable. See the table below.
(xValue) is the value to assign to the designated variable.
(nSetNmbr) is an optional parameter to designate the desired
variable by numeric representation rather than mnemonic
character representation. If this argument is passed, then
(cSetName) is ignored and is not required.
Clipper Environment Variables
(cSetNmbr) (cSetName)
---------- -------------
1 EXACT
2 FIXED
3 DECIMALS
4 DATEFORMAT
5 EPOCH
6 PATH
7 DEFAULT
8 EXCLUSIVE
9 SOFTSEEK
10 UNIQUE
11 DELETED
12 CANCEL
13 DEBUG
14 TYPEAHEAD
15 COLOR
16 CURSOR
17 CONSOLE
18 ALTERNATE
19 ALTFILE
20 DEVICE
21 EXTRA
22 EXTRAFILE
23 PRINTER
24 PRINTFILE
25 MARGIN
26 BELL
27 CONFIRM
28 ESCAPE
29 INSERT
30 EXIT
31 INTENSITY
32 SCOREBOARD
33 DELIMITERS
34 DELIMCHARS
35 WRAP
36 MESSAGE
37 MCENTER
38 SCROLLBREAK
dCLIP Environment Variables
(cSetNmbr) (cSetName)
---------- -------------
39 RDD
40 ODIR
41 PDIR
42 STEP
43 PROFILE
44 TRACE
45 PROMPT
46 PROMPTTYPE
47 SWAP
48 CLIPOPT
49 CLIPPATH
50 CLOAK
51 PEXT
52 TALK
53 STATUS
54 CANCEL
55 RESET
56 REEDIT
57 MAXROWS
58 FLDKEY
59 CHRKEY
60 QUERYKEY
61 INDEXKEY
62 STEPKEY
63 SPLIT
64 FLUSH
65 ECHO
66 PUBLIC
67 AUTOLOCK
68 SLASH
Returns:
The value of the designated environment variable.
Description:
DC_SETT() is used to change or report the value of any of the
38 Clipper SET environment variables or 30 dCLIP SET
environment variables.
Examples:
? DC_SETT( 'PDIR' )
F:\DCLIP3\PRG
? DC_SETT( 'DEVICE' )
.F.
? DC_SETT( 'DEFAULT' )
\CUSTOMER\DATA\
Source/Library:
_DCSET.PRG/.OBJ, DCLIP.LIB
See Also:
SET
dc_sort()
Pop-up a user-promt menu for creating a database sort
Syntax:
Arguments:
NONE
Returns:
A logical .TRUE. if the sort process is completed without any
errors or user abort.
Description:
DC_SORT() is a high-level function that provides a user-
interface menu for sorting records in a work area.
DC_SORT() prompts the user for information about files and
scoping conditions (with pick-list options), then displays a
progress-Odometer during the sorting process followed by the
final tally results.
Examples:
@ 11,10 prompt "Delete Records"
@ 12,10 prompt "Recall Records"
@ 13,10 prompt "Sort Records"
menu to nChoice
do case
case nChoice = 1
dc_append()
case nChoice = 2
dc_delete()
case nChoice = 3
DC_SORT()
endcase
Source/Library:
_DCSORT.PRG/.OBJ, DCLIP.LIB
See Also:
UTIL
dc_util()
SORT
dc_startscrn()
Save the startup screen
Syntax:
Arguments:
(lRestore) if .TRUE. will restore the startup screen.
If .FALSE. (default) then the current screen will
be saved.
Returns:
Nil
Description:
DC_STARTSCRN() is used to save the screen, cursor position,
and screen mode to be later restored just before quitting
the application.
Examples:
DC_STARTSCRN() // save the screen at start-up.
DC_STARTSCRN(.t.) // Restore the screen before Quitting.
Source/Library:
_DCSCRN.PRG/.OBJ, DCLIP.LIB
See Also:
dc_quit()
dc_statline()
Display a 3-bar status line of work area information
Syntax:
Arguments:
(nStrow) is the start display row of the 3-line status line.
(nMode) - 0 will leave the status on the screen, 1 will display
the status and an operator prompt to "press any key". After a
key is pressed, the screen will be restored.
Description:
DC_STATLINE() will display a 3-line status line with infor-
mation about the current work area. The information displayed
is the following:
Work Area | Database file | Database Filter |DEL|REL| Record No.
Alias | Index file | Index Key |EXC|UNI| Index No.
Rdd used | Current Tag | Index Filter |REA|DES|
Examples:
do while .t.
cls
DC_STATLINE(0,0)
@ 11,10 prompt "Open a database"
@ 12,10 prompt "Open an index"
@ 13,10 prompt "Database Utilities"
menu to nChoice
do case
case nChoice = 1
dc_dbfopen()
case nChoice = 2
dc_ntxopen()
case nChoice = 3
dc_util()
endcase
enddo
Source/Library:
_DCSTAT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_status()
DISPLAY STATUS
dc_statwin()
dc_status()
Display or print status of all work areas and environment
Syntax:
Arguments:
(cFileName) is an optional name of a file to write the status.
(lAppend) if .TRUE. will append the status to end of
(cFileName) otherwise the file will be overwritten.
(lWindow) if .TRUE. (default) will display the status in a
window and the user can scroll up or down through the window to
observe any portion of the status. The display will be
restored upon exiting the windoe. If .FALSE. the status will
scroll up the display and the user will be prompted to press
a key for each new screen.
(lWorkAreas) if .TRUE. will display only the status of the work
areas. If .FALSE. (default) the status of the 38 Clipper SET
environment variables and 30 dCLIP environment variables will
also be displayed.
Returns:
NIL
Description:
DC_STATUS() will display and/or output to the printer or file,
the status of all work areas and SET environment variables.
Examples:
do while .t.
cls
@ 11,10 prompt "Open a database"
@ 12,10 prompt "Open an index"
@ 13,10 prompt "Database Utilities"
@ 14,10 prompt "Display Status"
menu to nChoice
do case
case nChoice = 1
dc_dbfopen()
case nChoice = 2
dc_ntxopen()
case nChoice = 3
dc_util()
case nChoice = 4
DC_STATUS()
endcase
enddo
Source/Library:
_DCSTAT.PRG/.OBJ, DCLIP.LIB
See Also:
DISPLAY STATUS
dc_statwin()
dc_statwin()
Display a user-configurable window of work area information
Syntax:
Arguments:
(aStat) is a 2 - dimensional array which is used to configure
the status box. Subarray 1 consists of 4 numeric elements
which are the screen coordinates to display the window.
Subarray 2 is simply an array of numbers defining the
information and order you wish to display the status in the
window based on the following table:
1 Work area
2 Alias
3 Data Driver
4 Database file name
5 Record Pointer
6 Database filter expression
7 Index File name
8 Currently selected tag
9 Current index key
10 Index filter expression
11 Index Key number
12 *Deleted*
13 *Exclusive*/*Shared*
14 *ReadOnly*/*Read/Write*
15 *Relation*
16 *Unique*
17 *Descending*
For example if you wish to display only the Database file
name, Index file name, and Index filter expression, then sub-
array 2 would look like this:
{ 4, 7, 10 }
(nMode) = 0 - will display and leave the status on the screen
1 - will display the status and an operator prompt
to "press any key". After a key is pressed,
the screen will be restored.
2 - will store the (aStat) parameters to a STATIC
array so DC_STATWIN() can be recalled with no
parameters and display the same configuration
each time.
Description:
DC_STATWIN() will display a current work area status window
that is configurable to size and location and the amount of
information desired.
Examples:
// load STATIC array with configuration
DC_STATWIN( { {10,20,16,50}, {2,3,4,5,6} }, 2 )
// Assign key F2 to display status
setkey( -1, {||DC_STATWIN()} )
Source/Library:
_DCSTAT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_status()
DISPLAY STATUS
dc_step()
Load or clear an expression / procedure into the Step table
Syntax:
Arguments:
(cExpression) is an expression or procedure/function name in a
character string. If an expression is passed, then the
expression will be evaluated after each line of code (compiled
with /b switch) is executed. If the expression evaluates .TRUE.
then the program execution will stop and the source code will
be displayed on the current line. If (cExpression) is a
procedure or function name ( no parenthesis ), then the program
execution will stop when line (nNumber) of procedure
(cExpression) is executed.
(nNumber) can refer to either the line number of a specified
procedure to start step mode, or the position of an expression
in the step table to clear (remove) when using the (lClear)
option.
(lClear) if .TRUE. will clear (remove) a specified expression
from the step table. If (nNumber) is 0, then ALL step
expressions will be cleared.
(lStepOnly) if .TRUE. will step ONLY the procedure specified in
(cExpression) and bypass all other procedures.
(lStepAnd) if .TRUE. will start step mode only when ALL
expressions in the step table evaluate .TRUE., otherwise only
one of the expressions must evaluate .TRUE. to start step mode.
Returns:
nil
Description:
DC_STEP() is used to load an expression into the step table,
clear an expression from the step table, or establish a mode of
operation for source-level debugging. This function is used in
conjunction with DC_SETSTEP() to enable the start of step mode
operation.
Examples:
// - start step mode if CUSTOMER.DBF is opened or key F2 is
// - pressed
// - this example adds 2 expressions to the step table
DC_STEP( 'ALIAS() = "CUSTOMER"' )
DC_STEP( 'LASTKEY() = -1' )
// - start step mode on first line of function MYFUNC()
DC_STEP( 'MYFUNC' )
// - start step mode on line 123 of MYPROC()
DC_STEP( 'MYPROC', 123 )
// - clear step expression 2 from step table
DC_STEP( , 2, .t. )
// - clear all expressions from step table
DC_STEP( , 0, .t. )
// - step only through procedure GRAPH()
DC_STEP( 'GRAPH', , , .t. )
// - start step mode only if all expressions in table evaluate
// - .True.
DC_STEP( , , , , .t. )
// - start step mode if any expression in table evaluates
// - .True.
DC_STEP( , , , , .f. )
Source/Library:
_DCDBG.PRG/.OBJ, DCLIP.LIB
See Also:
STEP
dc_str2ar()
Convert a character string array to a multidimensional array
Syntax:
Arguments:
(cArray) is any character string containing the contents of
a multidimensional array saved with DC_AR2STR().
Returns:
A character string.
Description:
DC_STR2AR() will restore a multidimensional array from a
character string that was created with DC_AR2STR().
This function is handy when it is required to store an
array to a database field such as a character or memo
field.
Examples:
aDir := Directory()
USE dirs
REPLACE directory WITH DC_ar2str( aDir )
aDir := DC_STR2AR( directory )
Source/Library:
_DCASAVE.PRG/.OBJ, DCLIP.LIB
See Also:
dc_ar2str()
dc_strudbf()
Copy structure of a file to a dCLIP Structure extended file
Syntax:
Arguments:
(cFileName) is the name of the structure extended database to
create. If no argument is given then NEW_STRU.DBF is default.
Returns:
NIL
Description:
DC_STRUDBF() is used to create a "structure extended" database
to be used with DC_EDITSTRU(). A dCLIP structure extended
database is similar to any Clipper structure extended database
except that an extra field name is added so a field name may be
changed by DC_EDITSTRU() and the old field name is retained to
restore the data.
The database structure of the created file is as follows:
Field Nmbr Field Name Type Length Dec
1 FIELD_NAME C 10
2 FIELD_TYPE C 1
3 FIELD_LEN N 3 0
4 FIELD_DEC N 3 0
5 FIELD_OLD C 10
Examples:
use customer
// create a structure extended database
DC_STRUDBF( 'new_stru' )
if dc_editstru( 'new_stru' )
create custnew from new_stru
endif
Source/Library:
_DCFCSTR.PRG/.OBJ, DCLIP.LIB
See Also:
dc_modstru()
dc_struupdate()
dc_struupdate()
Update the structure of the current database
Syntax:
Arguments:
(aStructure) is a multi-dimensional array with one sub-array
for each database field. This may be a standard Clipper
structure array or an enhanced array with information about
previous field type(s) and field name(s).
Element Type Description
------ ---- ------------------------
[1] C Field Name
[2] C Field Type
[3] N Field Length
[4] N Field Decimals
[5] C Old Field Type (optional)
[6] C Old Field Name (optional)
(cNewFileName) is the name of the new file to create. If
parameter is not passed, then the new file will be given the
same name as the old file.
(lChangedType) if .TRUE. will use a "slower" method of update
to insure that data is properly restored. Pass this flag if
the type of one or more fields has changed and the array
does not contain the old information (element 5).
(lChangedName) if .TRUE. will use a "slower" method of update
to insure that data is properly restored. Pass this flag if
the name of one or more fields has changed and the array
does not contain the old information (element 6).
(lPrompt) if .TRUE. (default) will prompt the user with the
option of erasing the backup file(s) after the structure
update. If .FALSE. the backup files will not be erased and
the user will not be prompted.
Returns:
A logical .TRUE. if structure is updated. .FALSE. otherwise.
Description:
DC_STRUUPDATE() is used to update the structure of the current
work area in the event that the database structure required
by the program may be different from existing databases.
This function makes it easy to have your program automatically
update the structure of existing databases in the event that
fields have been added, deleted or re-sized. If you open your
databases with DC_DBFILE() and pass it a structure array, then
the databases will automatically be updated the first time the
new program is run.
Examples:
aStru := { ;
{ 'CUST_NAME','C',25,0 },;
{ 'CUST_NMBR','C',10,0 },;
{ 'LAST_DATE','D',8,0 } }
use customer
if .not. dc_isstru( aStru )
DC_STRUUPDATE( aStru )
endif
Source/Library:
_DCSTRU.PRG/.OBJ, DCLIP.LIB
See Also:
dc_dbfile()
dc_modstru()
dc_dbstru()
dc_strwrap()
Convert a string to a text array and specify line length
Syntax:
Arguments:
(cString) is a character string.
(nLength) is the length of each line in the output array.
Returns:
An array of strings that contains the original (cString)
information formatted to the length of (nLength).
Description:
DC_STRWRAP() is used to convert a long text string to multiple
lines of a specified length per line. This function is handy
when text must fit within a specified width of a display or
printout.
Examples:
. cString := 'The quick red fox jumped over the lazy dog.'
aText := DC_STRWRAP( cString, 10 )
for i := 1 to len(aText)
? aText[i]
next
The quick
red fox
jumped
over the
lazy dog.
Source/Library:
_DCSTR.PRG/.OBJ, DCLIP.LIB
dc_sum()
Pop-up a user-prompt menu for summing selected fields
Syntax:
Arguments:
NONE
Returns:
A Logical value of .TRUE. if records were summed, .FALSE. if the
operation is aborted.
Description:
DC_SUM() is a high-level function that provides a
user-interface menu for summing the value of specified fields
in a work area.
DC_SUM() prompts the user for information about files, fields,
and scoping conditions (with pick-list options), then displays
a progress-Odometer during the summing process followed by the
final results.
Examples:
. use invoice
. use invitems new
. set relation to inv_nmbr into invoice
. DC_SUM()
Source/Library:
_DCSUM.PRG/.OBJ, DCLIP.LIB
See Also:
SUM
UTIL
dc_util()
dc_superrdd()
Return and/or set the SUPER RDD name
Syntax:
Arguments:
(cRddName) is the name of the RDD to use as the SUPER RDD.
Returns:
The name of the currently selected Super Rdd.
Description:
DC_SUPERRDD() is basically a front-end to the Flex-File
V_SUPERRDD() function that will only set a SUPER RDD if it
exists. The SUPER RDD is the Replaceable Data Driver that
is "inherited" by FlexFile and must be set to the RDD desired
before USEing the file VIA FLEXFILE. The default SUPER RDD
is the default driver.
Examples:
// set the Super Rdd to COMIX
DC_SUPERRDD( 'DBFCMX' )
USE sales VIA FLEXFILE
Source/Library:
_DCRDD.PRG/.OBJ, DCLIP.LIB
See Also:
dc_setrdd()
SET RDD
dc_rddsel()
dc_tablename()
Return the Database file name of a Work Area
Syntax:
Arguments:
(nArea) is the work area. If no parameter is passed
then the currently selected work area will be used.
(cFileName) is the file name to store into the
table array. This parameter should not be passed if
the table name for the work area is being queried.
@(aTables) is the name of an array to store the names of
all databases that have been opened via the DC_USEAREA()
function. Each element is a character string containing
the following information:
Chars 1-3 : Work Area
Chars 5-14 : Alias
Chars 16-up : Database name
Returns:
A character string containing the name of the database
opened in the selected workarea.
Description:
DC_TABLENAME() is used to retrieve the name of a database
that has been opened via DC_USEAREA(). This function will
return the full path and file name of the database for a
work area. If you wish to use this function to retrieve
the name of a database, then you must use the DC_USEAREA()
function in lieu of Clipper's dbUseArea().
Examples:
set defa to C:\MYAPPS\DATA
select(10)
DC_UseArea( .f., "DBFCDX", "CUSTOMER" )
? DC_TABLENAME()
C:\MYAPPS\DATA\CUSTOMER.DBF
Source/Library:
_DCUSE.PRG/.OBJ, DCLIP.LIB
See Also:
dc_usearea()
dc_tagallcreate()
Create index tags for all fields in database
Syntax:
Arguments:
(cCDXName) is the name of the Combined Index file to create.
If no extension is given, then if the default extension for
combined indexes supported by the Data driver in use will be
appended.
If no (cCDXName) name is given, then the index will be created
using the same prefix as the open database and with the default
extension for combined indexes supported by the Data driver in
use.
(aFields) is a list of index tag names to create. The tag
name(s) must be the same as the name(s) of valid fields in the
current work area. If no argument is passed then tags for ALL
fields will be created.
(nLength) is an optional argument only to determine the maximum
length of character type indexes. For example, if you have a
character field of 100 bytes, you most likely will not want to
index on all 100 bytes, but instead on only the first 10
characters. If this argument is not passed, then a default length
of 10 will be used. If the length of any character field is less
than (nLength) then the index length for that specific tag will be
the field length.
Returns:
A logical .TRUE. if the index is successfully created, .FALSE.
otherwise.
Description:
DC_TAGALLCREATE() is used to create an index tag for all fields
(up to 99) in a database. This command is handy when you wish
to have an index for each field in the database and are using
the HUNT..RESUME .or DC_HUNT() "smart seeking" feature of
dCLIP.
Examples:
use maillist via 'DBFMDX'
DC_TAGALLCREATE('MAILLIST.MDX', ;
{"LAST", "COMPANY", "SOURCE"} )
dc_hunt( 'SCOTT' )
Source/Library:
_DCTAGS.PRG/.OBJ, DCLIP.LIB
dc_tagcreate()
Create new index Tag and add to the open combined index file
Syntax:
Arguments:
NONE
Returns:
A logical .TRUE. if the index tag is successfully created,
.FALSE. otherwise.
Description:
DC_TAGCREATE() is a high-level function that displays a user-
friendly menu for creating a combined index or adding a new tag
to an existing combined index. DC_TAGCREATE() will prompt the
user for information about the index tag and designate hot keys
to use the dCLIP index-builder for creating the key and the
condition builder for creating a conditional index tag. The
user will also be prompted to decide whether the index is
unique or descending.
Examples:
do while lastkey()#27
cls
@ 10,10 prompt "create a database"
@ 11,10 prompt "create an index tag"
menu to nChoice
do case
case nChoice = 1
dc_crdata()
case nChoice = 2
DC_TAGCREATE()
endcase
enddo
Source/Library:
_DCTAGS.PRG/.OBJ, DCLIP.LIB
dc_tagdelete()
Delete an index Tag from a pick-list of available tags
Syntax:
Arguments:
NONE
Description:
DC_TAGDELETE() is used to delete an index tag from a combined
index by selecting the tag to delete from a pick-list of
existing tags.
Examples:
do while lastkey()#27
cls
@ 10,10 prompt "create a database"
@ 11,10 prompt "create an index tag"
@ 12,10 prompt 'delete an index tag"
menu to nChoice
do case
case nChoice = 1
dc_crdata()
case nChoice = 2
dc_tagcreate()
case nChoice = 3
DC_TAGDELETE()
endcase
enddo
Source/Library:
_DCTAGS.PRG/.OBJ, DCLIP.LIB
dc_tagged()
Determine whether or not the current record is tagged
Syntax:
Arguments:
(aTags) is an existing array of record numbers which will
display the TAG marker in the browse display. If no
argument is given then the public DCTAGS array will be
used.
Returns:
A pointer to an array of tagged numbers.
Description:
DC_TAGGED() is used with database commands and functions to
determine whether or not the current record number is
contained in the Tag array.
A manifest symbol named TAGGED may be used in any expression
at the dot-prompt. This symbol is automatically translated
to DC_TAGGED(). This allows for simple use of the tagging
system by easy-to-enter commands.
Examples:
. select customer
. dc_rectagclear()
. go 113
. ? DC_TAGGED()
.F.
. dc_rectag(.f.)
. ? DC_TAGGED()
.T.
. dc_rectag(.t.)
. ? DC_TAGGED()
.F.
. dc_rectag(.f.,,{||balance)0})
. dc_rectag(.f.,,{||zip='92001'})
. dc_rectag(.t.,,{||balance(1000})
. count for DC_TAGGED()
. label form customer for DC_TAGGED() to print
Source/Library:
_DCRTAG.PRG/.OBJ, DCLIP.LIB
See Also:
dc_rectag()
dc_taginfo()
Return an array of information about tags in a combined index
Syntax:
Arguments:
NONE
Returns:
A multi-dimensional array with 1 subarray for each index
tag. Each sub-array contains the following information:
Element Type Description
------- ------ ---------------------
[1] C Tag Name
[2] C Index Key Expression
[3] C Index Condition Expression
[4] L Is it a Unique Index?
[5] L Is it a Descending Index?
[6] L Is it a Roll your own index?
Description:
Returns a multi-dimensional array of all the information about
all the tags in the currently selected combined index.
Source/Library:
_DCTAGS.PRG/.OBJ, DCLIP.LIB
dc_tagname()
Return the name of an index tag from a controlling order
Syntax:
Arguments:
(nOrder) is the index order. If no argument is given then the
currently selected order is default.
Returns:
A character string.
Description:
DC_TAGNAME() returns the name of an index tag in a combined index.
Examples:
// list all the tags in a combined index
local i, cTag
use sales via 'DBFSIX' index sales.cdx
for i := 1 to 99
cTag := DC_TAGNAME( i )
if empty(cTag)
exit
endif
? cTag
next
Source/Library:
_DCTAGS.PRG/.OBJ, DCLIP.LIB
dc_tagrestore()
Rebuild all Tags in a combined index from a Tag (.DCT) file
Syntax:
Arguments:
(cFileName) is the name of the combined index to restore. If
no argument is given then it is assumed that the currently
selected index is to be restored. (cFileName) must be the same
name as the index to restore except it will have the .DCT
extension.
Returns:
A numeric value.
0 - Index tags were successfully created.
1 - No index file name was passed.
2 - The current database driver does not support combined
indexes.
3 - The .DCT tag information file could not be found or
contains invalid information.
Description:
DC_TAGRESTORE() is used to restore all the tags in a combined
index from a .DCT tag information file that was created by
DC_TAGSAVE(). Restoring combined index files that contain many
index keys can be a large chore if the information about the
keys is not retained someplace other than in the index file.
If a combined index becomes corrupted or deleted, then the tag
information in a .DCT tag file is valuable.
DC_TAGRESTORE() will rebuild all the index tags and also
display a progress indicator and information about each tag
being created.
Examples:
use customer via 'DBFSIX'
index on cust_name tag custname of customer
index on cust_nmbr tag custnmbr of customer
index on recno() tag 714 of customer for area = '714'
index on recno() tag 619 of customer for area = '619'
dc_savetags()
set index to
erase customer.cdx
DC_RESTORETAGS()
Source/Library:
_DCTAGS.PRG/.OBJ, DCLIP.LIB
See Also:
dc_tagsave()
dc_tagsave()
Save information about all tags to a Tag (.DCT) file
Syntax:
Arguments:
(cFileName) is the name of the file to create. If no argument
is given then the file name is the same as the selected index
file information to be saved, except with the .DCT extension.
(nOrder) is the index order. If no argument is given, then the
currently selected index will be saved.
Description:
DC_TAGSAVE() is used to save the structure of all the tags in
an open "combined" index file or in a set of open individual
index files to a .DCT file.
A .DCT file contains all the information needed to recreate
the combined indexes or individual indexes by using the
RESTORE TAGS command or DC_TAGRESTORE() function.
Use DC_TAGSAVE() to convert one type of index to another.
For example, let's say you have a database named CUSTOMER.DBF
that uses indexes named NAME.NTX, COMPANY.NTX, ZIP.NTX and
PHONE.NTX. To create a new "combined" index named CUSTOMER.CDX
from the .NTX files simply do the following:
. USE CUSTOMER VIA DBFNTX INDEX NAME,COMPANY,ZIP,PHONE
. DC_TAGSAVE('CTAGS')
. USE CUSTOMER VIA DBFSIX
. DC_TAGRESTORE('CTAGS')
Use DC_TAGSAVE() to save information about a combined index so
you may rebuild the index in the event that it becomes deleted
or corrupted.
Examples:
use customer via 'DBFSIX'
index on cust_name tag custname of customer
index on cust_nmbr tag custnmbr of customer
index on recno() tag 714 of customer for area = '714'
index on recno() tag 619 of customer for area = '619'
DC_SAVETAGS()
set index to
erase customer.cdx
dc_restoretags()
Source/Library:
_DCTAGS.PRG/.OBJ, DCLIP.LIB
See Also:
dc_tagrestore()
dc_tagsel()
Select an index Tag from a pick-list of available tags
Syntax:
Arguments:
(nOrder) is the index order. If no argument is given then the
tags for the currently selected index will be displayed.
Description:
DC_TAGSEL() pops-up a user pick-list of available index tags to
choose a new tag. The currently selected tag will be
highlighted in the display. If the user chooses a new tag,
then the tag chosen will be selected. If the user presses the
ESCape key, then NO tag will be selected.
Examples:
do while lastkey()#27
cls
@ 10,10 prompt "open a database"
@ 11,10 prompt "open an index file"
@ 12,10 prompt "select an index tag"
@ 13,10 prompt "browse database"
menu to nChoice
do case
case nChoice = 1
dc_dbfopen()
case nChoice = 2
dc_ntxopen()
case nChoice = 3
DC_TAGSEL()
case nChoice = 4
dc_browsedb()
endcase
enddo
Source/Library:
_DCTAGS.PRG/.OBJ, DCLIP.LIB
See Also:
SET TAG
dc_tbinkey()
A special version of INKEY() for adding mouse to Tbrowse system
Syntax:
Arguments:
(oObject) is the name of the Tbrowse object to mouse.
(nDelay) is the amount of seconds to wait for a key click or
mouse click. If zero, then wait forever.
(aButtons) is an optional multi-dimensional array of mouse-
buttons that must meet the criteria specified for the
DC_MOUSEKEY() function. If the mouse is clicked within a
specified region the value returned by will be the key value
passed in the array.
(aNavigate) is an optional multi-dimensional array of mouse-
button coordinates to be used for navigation. There are a
total of 10 sub-arrays required, each with 4 numeric elements
designating the coordinates on the screen. If the mouse is
clicked within the specified coordinates, then the activity
will be performed.
Subarray Description Default
-------- ----------- ------------
1 Pan Left (same as K_CTRL_LEFT) o:nLeft-1
2 Pan Right (same as K_CTRL_RIGHT) o:nRight+1
3 Move up one Row (same as K_UP) o:nTop+1
4 Move down one Row (same as K_DOWN) o:nBottom-1
5 Page Up (same as K_PGUP) o:nTop
6 Page Down (same as K_PGDN) o:nBottom
7 Pan Home (same as K_CTRL_HOME) Col 0
8 Pan End (same as K_CTRL_END) Col 79
9 Top (same as K_CTRL_PGUP) Row 0
10 Bottom (same as K_CTRL_PGDN) MaxRow()
If no array is passed, then the coordinates for the above
functions will be equivalent to the default values.
Note: Due to Tbrowse limitations, DC_TBINKEY() calculates
the active area of the screen by scanning the columns in
the object to determine the number of heading and footing
rows. This can slow down operation, therefore, to regain
speed it is recommended that you pass two parameters:
(nStartRow) - Starting data row (screen row)
(nEndRow) - Ending data row (screen row)
Returns:
A numeric value equivalent to one of the following:
a. -101 if the mouse is clicked within the navigation region.
b. The INKEY value of any key pressed.
c. The value in (aButtons), element #5 if the mouse is
clicked in an (aButtons) region.
Description:
DC_TBINKEY() is used to easily convert existing Tbrowse
systems to work with a mouse. In most case, simply replacing
the call to INKEY() in the Tbrowse key input handler to a call
DC_TBINKEY() is all that's required.
Examples:
// Start of Tbrowse Key Check routine
do while lastkey()#27
do while !b:stabilize()
enddo
k := DC_TBINKEY(b,0,,,5,22)
do case
case k=K_DOWN
b:down()
case k=K_UP
b:up()
case k=K_PGDN
b:pagedown()
case k=K_PGUP
b:pageup()
case k=K_CTRL_PGUP
b:gotop()
case k=K_CTRL_PGDN
b:gobottom()
case k=K_RIGHT
b:right()
case k=K_LEFT
b:left()
case k=K_HOME
b:home()
case k=K_END
b:end()
case k=K_CTRL_LEFT
b:panleft()
case k=K_CTRL_RIGHT
b:panright()
case k=K_CTRL_HOME
b:panhome()
case k=K_CTRL_END
b:panend()
endcase
enddo
Source/Library:
_DCTBINK.PRG/.OBJ, DCLIP.LIB
See Also:
dc_inkey()
dc_mousekey()
dc_textbrow()
Browse large text files
Syntax:
Arguments:
(cFileName) is the text file to browse.
Returns:
Nil.
Description:
DC_TEXTBROW() is used to browse text files that are larger than
64k. DC_MEMOBASE() has also been modified to support browsing
of text that is larger than 64k by breaking the text into 60k
segments, storing the segments into an array, and passing the
array to DC_MEMOBASE() instead of the text tsring. DC_MEMOBASE()
is used as the text browser. To go to the next or previous pages
of text use the Alt-PgDn/Alt-PgUp keys.
Examples:
DC_TEXTBROW('DCLIP.LOG')
Source/Library:
_DCTEXT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_memobase()
dc_textmerge()
Merge text with data
Syntax:
Arguments:
(cMemoText) is the text that is to be merged with the data.
Data that is to be merged into the text is handled by a set
of TAGS that are defined at the top of the text. Each tag
is a single letter defined as follows:
((A)) (expression)
When a matching tag in the text is encountered, the area of
the text defined by the tag is replaced by the contents of
the expression previously defined for each tag.
Returns:
A character string.
Description:
DC_TEXTMERGE() is used to merge database information with
text information.
Examples:
-- Example of LETTER.TXT --
((A)) DM011-)pvrname
((B)) DM011-)pvrfname
((C)) DM011-)pvrlname
((D)) DM011-)addr1
((E)) DM011-)city
((F)) DM011-)state
((G)) DM011-)zipcode
((H)) DM011-)wkac1
((I)) DM011-)wkphone1
((J)) DM011-)faxac
((K)) DM011-)faxphone
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
SERVING PEOPLE, SERVING PEOPLE
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
You have been listed among 160,000 behaviorial health service providers
on the world wide web. Your name (and organization) is now available
to purchasers of behavioral health services and organizations creating
provider networks for centralized triage processes.
The accuracy of your listing is very important. Please take this
opportunity to review the listing and report any error by return fax.
Current Listing Change To (please print)
(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) _________________________________
(BBBBBBBBBBBBBBBB) (CCCCCCCCCCCCCCC) _______________ _________________
(DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD) _________________________________
(EEEEEEEEEEEEEEEEEE) (FF) (GGGGGGGG) __________________ ___ __________
Voice ((H)) (IIIIIIIIIIIIIIIIIIII) ( ) ___________________________
Fax ((J)) (KKKKKKKKKKKKKKKKKKKK) ( ) ___________________________
-- Example of Merging LETTER.TXT with Data --
cText := MemoRead('LETTER.TXT')
USE DM011
DO WHILE !Eof()
DC_FaxAdd( ;
nil, ;
DM011-)faxphone,;
nil,;
nil,;
'OURLOGO.BMP',;
DC_TEXTMERGE(cMemo) )
SKIP
ENDDO
Source/Library:
_DCTEXT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_faxbatch()
dc_merge()
dc_token()
Extract a token from a string
Syntax:
Arguments:
(cString) is a character string containing tokens.
(cDelims) is a character string containing the delimeter(s)
to use between tokens. If no parameter is passed then the
following default set of delimeters will be used:
(SPACE)
Š,.;:!?/()#&%+-*
(CHR(0))
(CHR(9))
(CHR(10))
(CHR(13))
(CHR(26))
(nOccurence) is the number of the token to extract.
Returns:
A character string.
Description:
DC_TOKEN() is used to extract a portion of a character
string based on it's "token" position within the string.
Tokens are sub-strings within a string that are separated
by common delimiters.
Examples:
cString := 'This is a test'
? DC_TOKEN( cString,,2 )
is
cString := 'AB|CD|EF|GHI|JKLM|NOP|QR|STUVW|XYZ'
? DC_TOKEN( cString,'|',5 )
JKLM
Source/Library:
_DCTOKEN.PRG/.OBJ, DCLIP.LIB
See Also:
dc_tokenarray()
dc_tokenarray()
Parse all tokens in a string to an Array
Syntax:
Arguments:
(cString) is a character string containing tokens.
(cDelims) is a character string containing the delimeter(s)
to use between tokens. If no parameter is passed then the
following default set of delimeters will be used:
(SPACE)
Š,.;:!?/()#&%+-*
(CHR(0))
(CHR(9))
(CHR(10))
(CHR(13))
(CHR(26))
Returns:
A array of character strings.
Description:
DC_TOKENARRAY() is used to return an array of character
strings derived from a single character string. Tokens are
sub-strings within a string that are separated by common
delimiters. The array returned will contain one element for
each token in the string.
Examples:
cString := 'AB|CD|EF|GHI|JKLM|NOP|QR|STUVW|XYZ'
aTokens := DC_TOKENARRAY( cString,'|' )
display array aTokens
[1] C AB
[2] C CD
[3] C EF
[4] C GHI
[5] C JKLM
[6] C NOP
[7] C QR
[8] C STUVW
[9] C XYZ
Source/Library:
_DCTOKEN.PRG/.OBJ, DCLIP.LIB
See Also:
dc_token()
dc_tokenjustify()
Perform text-justfication of tokens in a string
Syntax:
Arguments:
(cString) is a character string containing tokens.
(cDelims) is a character string containing the delimeter(s)
to use between tokens. If no parameter is passed then the
following default set of delimeters will be used:
(SPACE)
Š,.;:!?/()#&%+-*
(CHR(0))
(CHR(9))
(CHR(10))
(CHR(13))
(CHR(26))
(nWidth) is the final width of the resultant character
string.
(nType) is used to denote the type of justification to
perform:
0 - Center Justify to fit (nWidth) characters
1 - Pad Right until (nWidth) characters
2 - Left Justify. Pad right to (nWidth) characters
3 - Pad Left until (nWidth) characters
4 - Right Justify. Pad left to (nWidth) characters
Returns:
A character string.
Description:
DC_TOKENJUSTIFY() is used to perform text justification of
all tokens in a character string.
Tokens are sub-strings within a string that are separated
by common delimiters.
Examples:
cString := 'This is a test'
? DC_TOKENJUSTIFY( cString,,50,0 )
This is a test
Source/Library:
_DCTOKEN.PRG/.OBJ, DCLIP.LIB
See Also:
dc_token()
dc_tokenarray()
dc_tokennum()
Determine the number of tokens in a string
Syntax:
Arguments:
(cString) is a character string containing tokens.
(cDelims) is a character string containing the delimeter(s)
to use between tokens. If no parameter is passed then the
following default set of delimeters will be used:
(SPACE)
Š,.;:!?/()#&%+-*
(CHR(0))
(CHR(9))
(CHR(10))
(CHR(13))
(CHR(26))
Returns:
A numeric value.
Description:
DC_TOKENNUM() is used to determine the number of tokens
that exist in a character string.
Tokens are sub-strings within a string that are separated
by common delimiters.
Examples:
cString := 'This is a test'
? DC_Token( cString,,2 )
is
? DC_NUMTOKEN( cString )
4
cString := 'AB|CD|EF|GHI|JKLM|NOP|QR|STUVW|XYZ'
? DC_Token( cString,'|',5 )
JKLM
? DC_NUMTOKEN( cString )
9
Source/Library:
_DCTOKEN.PRG/.OBJ, DCLIP.LIB
See Also:
dc_token()
dc_tokenarray()
dc_tone()
A front-end to Tone() that doesn't lock computer
Syntax:
Arguments:
See Clipper 5.x Guides - TONE()
Returns:
NIL
Description:
DC_TONE() is a front-end to Clipper's TONE() function with a
call to INKEY() before calling TONE(). For some reason this
fixes lockups that can occur with TONE() in some situations.
Source/Library:
_DCTONE.PRG/.OBJ, DCLIP.LIB
dc_trace()
Activate trace mode to profile an application
Syntax:
Arguments:
(lTraceOn) if .TRUE. will START tracing when (cTraceProc)
evaluates .true. (lTraceOn) if .FALSE. will STOP tracing when
(cTraceProc) evaluates .true.
(cTraceProc) is an expression or procedure name. If
(cTraceProc) is a procedure name, then tracing will start/stop
when (nLineNmbr) of procedure (cTraceProc) is executed. If
(cTraceProc) is an expression, then tracing will start/stop
when (cTraceProc) evaluates .true.
(lTraceOnly) if .TRUE. will enable trace mode only when
executing procedure (cTraceProc). Tracing will be temporarily
terminated when any procedure other than (cTraceProc) is
executing.
(lClear) will clear trace mode expessions.
(nLineNmbr) is used only with (cTraceProc). See description
above.
Returns:
NIL
Description:
DC_TRACE() is used to start or terminate trace debugging.
Trace mode will write the PROCEDURE name, LINE number, and
WATCH values into a file named DCTRACE for each line of
application code that executes. Only code which has been
compiled with line numbers will be traced and only code which
has been actually "executed" during the running of the program
will be traced.
Use your editor to view the contents of the DCTRACE file or use
DC_TRCONV() to convert the trace file to a text file which is a
merging of your source code and the trace file data.
The information in the DCTRACE file will be stored as follows:
Date: 11/01/89
Time: 12:15:33
Watch 1 = Lastkey()
Watch 2 = row
Watch 3 = col
Proc Line W1 W2 W3
TTRAK 27 54 0 0
TTRAK 28 54 0 0
TTDAILY 1 44 0 0
TTDAILY 2 44 1 0
TTDAILY 3 44 1 1
TTDAILY 11 44 1 1
Examples:
// start tracing at the next line of code
DC_TRACE(.t.)
// stop tracing at the next line of code
DC_TRACE(.f.)
// start tracing when F2 pressed
DC_TRACE(.t.,'LASTKEY()=-1')
// stop tracing when ESCape pressed
DC_TRACE(.f.,'LASTKEY()=27')
// start tracing at procedure GRAPH line 123
DC_TRACE(.t.,'GRAPH',,,,123)
// stop tracing at procedure BROWSE line 540
DC_TRACE(.f.,'BROWSE',,,,540)
// clear all trace expressions
DC_TRACE(,,,,.t.)
// trace only when executing procedure MYEDITOR
DC_TRACE(,'MYEDITOR',.t.)
Source/Library:
_DCDBG.PRG/.OBJ, DCLIP.LIB
dc_tracesize()
Set Maximum size of Trace File
Syntax:
Arguments:
(nSize) is the maximum size of the Trace File (in Bytes).
The default is 100000.
Returns:
The previous trace file size setting.
Description:
DC_TRACESIZE() is used to establish the maximum size of the
DCTRACE file that gets created in TRACE MODE. This setting
prevents the disk from being filled up in the event that the
TRACE MODE is inadvertenly left on.
Examples:
DC_TRACESIZE(500000)
Source/Library:
_DCDBG.PRG/.OBJ, DCLIP.LIB
See Also:
dc_trace()
SET TRACESIZE
TRACESIZE =
dc_tranarray()
Convert a function sequence from a string to an array
Syntax:
Arguments:
(cFunction) is a character string of expressions separated by
semicolons or carriage-return/line feed.
Returns:
An array of character string expressions.
Description:
DC_TRANARRAY() is a fully-recursive command translator that
translates a series of commands in a command string into an
array of functions to be executed via the macro-compiler.
DC_TRANARRAY() will scan the the pre-processor "TRANSLATE"
sub-arrays and test to see if the command verb and its
arguments match any loaded commands. If the command is not
found in the pre-processor arrays, then the scan will be
continued to see if there is a match to any of the commands in
the default (linked-in) command set which supports all Clipper
and dCLIP commands.
Examples:
-- Example 1 -
aFunctions := ;
DC_TRANARRAY( 'CLS; CLOSE ALL; DISPLAY STATUS' )
dc_disparray( aFunctions )
[1] C Scroll()
[2] C SetPos(0,0)
[3] C dbCloseAll()
[4] C select(1)
[5] C __SetFormat(NIL)
[6] C DC_STATUS(,.f.,.t.)
-- Example 2 --
// this example allows the user to enter a series of commands
// in a memo and then translate and execute the commands.
aCommands := hardcr(memoedit())
aFunctions := DC_TRANARRAY( aCommands )
for i := 1 to len(aFunctions)
cMacro := aFunctions[i]
xDummy := &cMacro
next
Source/Library:
_DCTRAN1.PRG/.OBJ, DCLIP.LIB
dc_trandefault()
Load Default Clipper .CH set(s)
Syntax:
Arguments:
(cSetName) is the name of the set to load.
Returns:
A logical .TRUE. if the command set was successfully loaded,
.FALSE. otherwise.
Description:
DC_TRANDEFAULT() is used to load default sets of Clipper
manifest translations into the pre-processor translate
array. These manifest constants can be loaded via the
INCLUDE command or DC_PREINCLUDE() function, but then the
appropriate *.CH files must be available to load. The
DC_TRANDEFAULT() function includes these command sets in the
.EXEcutable program so they can be loaded into the runtime
arrays by simply calling the function.
Examples:
-- Example 1 --
. ? K_ESC
Variable does not exist Base[1003]
. DC_TRANDEFAULT( "INKEY" )
. ? K_ESC
27
Source/Library:
_DCTRAN2.PRG/.OBJ, DCLIP.LIB
See Also:
INCLUDE DEFAULT
dc_translate()
Translate a command line to an array of functions
Syntax:
Arguments:
(cCommandLine) is any command string that contains Clipper
commands, dCLIP commands or commands from pre-processor files
loaded with the INCLUDE command or DC_INCLUDE() function.
Returns:
An array of character strings. Each string is an expression.
If the translation is unsuccessful, then the array will be empty.
Description:
DC_TRANSLATE() is a fully-recursive command translator that
translates commands into an array of functions to be executed
via the macro-compiler. DC_TRANSLATE() will first scan the
pre-processor "DEFINE" sub-arrays and convert any manifest
constants that have been re-defined. Next, it will scan the
pre-processor "TRANSLATE" sub-arrays and test to see if the
command verb and its arguments match any loaded commands. If
the command is not found in the pre-processor arrays, then the
scan will be continued to see if there is a match to any of the
commands in the default (linked-in) command set which supports
all Clipper and dCLIP commands.
If the command syntax entered matches a command in the
pre-processor arrays or the defaults, then it will be converted
to an array of character expressions.
Examples:
-- Example 1 --
dc_predefadd( "K_ESC 27" )
dc_predefadd( "ABORTED INKEY()=K_ESC" )
dc_pretradd( ;
"BACKUP (dir) [WHILE (w)] =) mybackup(((dir)),({w})); DONE" )
dc_pretradd( "DONE =) __quit()" )
aFunctions := ;
DC_TRANSLATE( "BACKUP \CUSTOMER WHILE !ABORTED" )
dc_disparr(aFunctions)
[1] mybackup("\CUSTOMER",{||!INKEY()=27})
[2] __quit()
-- Example 2 --
accept "enter a command" to cCommand
aFunctions := DC_TRANSLATE( cCommand )
for i := 1 to len(aFunctions)
cMacro := aFunctions[i]
xDummy := &cMacro
next
Source/Library:
_DCTRAN1.PRG/.OBJ, DCLIP.LIB
See Also:
DEFINE
INCLUDE
dc_trconv()
Convert a Trace file
Syntax:
Arguments:
(cFileName) is the name of the file to create from the DCTRACE
file and your source code files or the name of the printer
device to send the output.
If no parameter is given, then a file named DCTRACE.TXT is
assumed.
DC_TRCONV() will overwrite any file you specify.
Returns:
NIL
Description:
DC_TRCONV() will convert a DCTRACE file from PROC names and
LINE numbers to actual source code from your source code files.
1. This is a sample input file (DCTRACE) :
Date: 11/01/89
Time: 12:15:33
Watch 1 = Lastkey()
Watch 2 = row
Watch 3 = col
Watch 4= ALIAS()
Proc Line W1 W2 W3 W4
TTRAK 27 54 0 0 ""
TTRAK 28 54 0 0 ""
TTDAILY 1 44 0 0 ""
TTDAILY 2 44 3 0 ""
TTDAILY 3 44 3 10 ""
TTDAILY 11 44 3 10 ""
2. This is a sample output file (expC1) :
Watch 1 = Lastkey()
Watch 2 = row
Watch 3 = col
Watch 4 = ALIAS()
Proc TTRAK Src TTTRAK.PRG W1 W2 W3 W4
27 IF LASTKEY()=44 44 0 0 ""
28 DO ttdaily 44 0 0 ""
Proc TTDAILY Src TTDAILY.PRG W1 W2 W3 ""
1 CLEAR 44 0 0 ""
2 STORE 3 TO row 44 3 0 ""
3 STORE 10 TO col 44 3 10 ""
11 STORE 1 TO page 44 3 10 ""
12 USE sales 44 3 10 "SALES"
Notes:
DC_TRCONV() requires that your source code exist in the current
directory, the DOS APPEND path, or the directory identified
with the PDIR=(directory) command in your DCLIP.SYS file.
For DC_TRCONV() to find your source code files you may need to
load a .LST map file with the DC_MAPLOAD() function or MAP
command.
Examples:
dc_trace(.t.) // start tracing to DCTRACE file
dc_trace(.f.) // stop tracing
DC_TRCONV() // convert DCTRACE file to DCTRACE.TXT file
Source/Library:
_DCTRACE.PRG/.OBJ, DCLIP.LIB
See Also:
TRACE
TRACE CONVERT
dc_trace()
dc_tstcond()
Test if a condition is valid
Syntax:
Arguments:
(cCondition) is any expression.
(lDisplayError) if .TRUE. (default) will display an "Invalid
Condition" error if the condition is not valid.
Returns:
A logical .TRUE. if the condition is valid, .FALSE. otherwise.
Description:
DC_TSTCOND() is used to test the validity of an expression.
Examples:
use customer
accept "enter a condition for output" to cCondition
if DC_TSTCOND( cCondition )
report form custlist for &cCondition
endif
Source/Library:
_DCTSTC.PRG/.OBJ, DCLIP.LIB
dc_tstfile()
Test for existence or ability to create a file.
Syntax:
Arguments:
(cFileName) = filename including optional drive and directory.
If no drive/and directory are included then the SET DEFAULT
directory or DOS directory is assumed (depending on the value
of (lDosDir).
(lExist) = .t. - Return .t. if file exists.
Return .f. if file does not exist
.f. - Return .t. if file does not exist
Return .t. if file exists and OK to overwrite.
Return .f. if file exists and no overwrite.
(lPrompt) = .t. - Will prompt operator if error
.f. - Will not prompt operator
(lCreateNew) if .TRUE. will prompt the operator if the
file cannot be created as a new file. .FALSE. is the default.
(lDosDir) if .TRUE. will test the currently selected DOS
directory, otherwise the currently selected SET DEFAULT
directory will be assumed.
Returns:
A logical value.
Description:
DC_TSTFILE() is used to test for existence of file on disk.
DC_TSTFILE() allows two modes of operation depending on the
value of the passed parameter (lExist).
MODE 1
If (lExist) is .TRUE., DC_TSTFILE() will check for the
existence of a file in the event that you want to open a file.
The user will be notified if the file does not exist and a
logical .FALSE. will be returned. If the file exists then a
logical .TRUE. will be returned.
MODE 2
If (lExist) is .FALSE., DC_TSTFILE() will check to make sure
that a file does not already exist in the event that you are
trying to create a new file and do not want to write over any
existing file. The user will be notified if the file already
exists and be prompted if it is ok to overwrite the file. If
the user answers NO, then a logical .FALSE. will be returned.
If the file does not exist, or the user answers that it is OK
to overwrite the file, then a logical .TRUE. will be returned.
Examples:
-- Example 1 --
accept "enter file name to open" to cFileName
if DC_TSTFILE( cFileName, .t., .t. )
nHandle := fopen( cFileName )
else
break
endif
-- Example 2 --
accept "enter file name to create" to cFileName
if DC_TSTFILE( cFileName, .f., .t. )
nHandle := fcreate( cFileName )
else
break
endif
Source/Library:
_DCTSTFL.PRG/.OBJ, DCLIP.LIB
dc_turbconfig()
Define the system turbo editor
Syntax:
Arguments:
(aConfiguration) is a four (4) element array consisting of the
following arguments:
Element Type Description
------- ---------- ----------------------------------------
[1] Character File Name
This is the name of the editor .COM, .BAT or .EXE file to
run when using the / command or DC_TURBEDIT() function.
[2] Character Memory Swap
This is the amount of memory to release and save to disk
to run the program. The default is (K). Enter "0" to
release all memory except shell.
[3] Character Swap drive
This is the name of primary and secondary Disk Drive/
Directory (separated by a semicolon) to save the memory
image. A temporary file is created on the first drive if
space is available. If no space is left on the first
drive/directory then the remainder of the memory image is
created on the second specified drive/directory. The
temporary file is erased upon returning from your editor.
[4] Character Video Mode
"H" - Set High Resolution mode (43/50 lines)
"L" - Set Low Resolution mode (25 lines)
"" - Don't change video mode
Returns:
An array containing the current editor configuration. If no array
argument is passed, then the previous configuration will be returned.
See Arguments for a description of each element of the returned array.
Description:
DC_TURBCONFIG() is used to configure the system editor to be
called when using the / command or DC_TURBEDIT() function. The
system editor can be any DOS executable program and is called
via the gateway system.
Examples:
DC_TURBCONFIG( { 'Q2.BAT','200','C:\;D:\','L' } )
dc_turbedit()
Source/Library:
_DCMAKE.PRG/.OBJ, DCLIP.LIB
See Also:
/
dc_turbedit()
TURBO =
dc_turbedit()
Invoke a Turbo Edit-Compile-Do sequence
Syntax:
Arguments:
(cCommand) is a set of commands to compile and run (separated
by semi-colons).
If no argument is passed, then the system Turbo-Editor will be
used and the name of the file defined by the SLASH= command in
DCLIP.SYS or DC_SETT('SLASH',(cProgram)) will be edited,
compiled and executed.
Description:
DC_TURBEDIT() is used to invoke an Edit-Compile-Do sequence.
This is functionally equivalent to using the / command at the
dot prompt.
Notes:
If the drive and directory is not included in the (cFileName)
argument, then DC_TURBEDIT() will search for the file first in
the SET DCLIP directory followed by the SET PDIR directory.
Examples:
dc_turbconfig( { 'Q2.BAT','300','C:\;D:\','L' } )
DC_TURBEDIT()
Source/Library:
_DCMAKE.PRG/.OBJ, DCLIP.LIB
See Also:
/
EDIT PRG
dc_turbo()
A "turbo-style" integrated development environment (IDE)
Syntax:
Arguments:
NONE
Description:
DC_TURBO() is a complete menu-drive IDE (integrated development
environment) that allows you to do complete development from a
set of pull-down menus.
See Also:
TURBO
ASSIST
dc_assist()
dc_tutor()
A tutoring system for Clipper/dCLIP command ands functions
Syntax:
Arguments:
(idCommand) | (idFunction) is the name of the command or
function to jump to in the DCTUTOR database.
If no argument is given, then DC_TUTOR() will return to the
screen that was last accessed during the previous tutoring
session.
Description:
DC_TUTOR() is a data-driven tutoring system designed to teach
how to use all Clipper commands and functions and dCLIP
commands and functions.
This learn-by-example tutoring system utilizes both the
interpreter and the turbo-compiler/linker features of dCLIP to
run code samples for demonstrating how to use each command or
function.
Description text and code samples are saved in memo fields in
the DCTUTOR.DBF database and can be easily modified by the
operator.
Source/Library:
_DCTUTOR.PRG/.OBJ, DCLIP.LIB
See Also:
TUTOR
dc_txtclose()
Close text file
Syntax:
Arguments:
(nHandle) is the numeric file handle returned by DC_TXTOPEN().
Caution: This is NOT the dos file handle.
Returns:
A logical .TRUE. if the file was successfully closed.
Description:
DC_TXTCLOSE() is used to close a text file that was opened with
DC_TXTOPEN().
Examples:
nHandle := dc_txtopen( 'dclip.sys' )
do while !dc_txteof( nHandle )
? dc_txtline( nHandle )
dc_txtskip( nHandle, 1 )
enddo
DC_TXTCLOSE( nHandle )
Source/Library:
_DCTXT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_txtopen()
dc_txtcount()
Return the number of lines in an open text file
Syntax:
Arguments:
(nHandle) is the numeric file handle returned by DC_TXTOPEN().
Caution: This is NOT the dos file handle.
Returns:
A number value equal to the number of lines in the text file.
Description:
DC_TXTCOUNT() is used to report the number of lines in a text
file that was opened with DC_TXTOPEN().
Examples:
nHandle := dc_txtopen( 'dclip.sys' )
if DC_TXTCOUNT( nHandle ) ( 100
do while !dc_txteof( nHandle )
? dc_txtline( nHandle )
dc_txtskip( nHandle, 1 )
enddo
dc_txtclose( nHandle )
endif
Source/Library:
_DCTXT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_txtopen()
dc_txteof()
Is file pointer at end of text file?
Syntax:
Arguments:
(nHandle) is the numeric file handle returned by DC_TXTOPEN().
Caution: This is NOT the dos file handle.
Returns:
A logical .TRUE. if the file pointer is at the end of the text
file, .FALSE. otherwise.
Description:
DC_TXTEOF() reports whether the file pointer is at the end of a
text file that was opened with DC_TXTOPEN().
Examples:
nHandle := dc_txtopen( 'dclip.sys' )
do while !DC_TXTEOF( nHandle )
? dc_txtline( nHandle )
dc_txtskip( nHandle, 1 )
enddo
dc_txtclose( nHandle )
Source/Library:
_DCTXT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_txtopen()
dc_txtgoto()
Goto a specified line in a text file
Syntax:
Arguments:
(nHandle) is the numeric file handle returned by DC_TXTOPEN().
Caution: This is NOT the dos file handle.
(nLineNumber) is the line in the text file to go to.
Returns:
A logical .TRUE. if the file pointer was successfully moved to
the specified line, .FALSE. otherwise.
Description:
DC_TXTGOTO() is used to go to a specified line of text in a
text file that was opened with DC_TXTOPEN().
Examples:
// This example will open the source code file and extract the
// line of code that caused a runtime error.
proc myerror
cPrgName := dc_objfind( procname(1) )
nLineNo := procline(1)
nHandle := dc_txtopen( cPrgName )
DC_TXTGOTO( nHandle, nLineNo )
? "This is the line of code that caused the error:"
? dc_txtline( nHandle )
dc_txtclose( nHandle )
Source/Library:
_DCTXT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_txtopen()
dc_txtline()
Read the current line of a text file
Syntax:
Arguments:
(nHandle) is the numeric file handle returned by DC_TXTOPEN().
Caution: This is NOT the dos file handle.
Returns:
A string containing the contents of the current text line.
Description:
DC_TXTLINE() will return the contents of the current line of
text in a text file opened with DC_TXTOPEN().
Examples:
nHandle := dc_txtopen( 'dclip.sys' )
do while !dc_txteof( nHandle )
? DC_TXTLINE( nHandle )
dc_txtskip( nHandle, 1 )
enddo
dc_txtclose( nHandle )
Source/Library:
_DCTXT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_txtopen()
dc_txtlno()
Report the current line pointer of an open text file
Syntax:
Arguments:
(nHandle) is the numeric file handle returned by DC_TXTOPEN().
Caution: This is NOT the dos file handle.
Returns:
The current line number pointer of the text file.
Description:
DC_TXTLNO() is used to report the current line pointer in a
text file that was opened with DC_TXTOPEN().
Examples:
nHandle := dc_txtopen( 'dclip.sys' )
? DC_TXTLNO( nHandle )
1
dc_txtskip( nHandle, 2 )
? DC_TXTLNO( nHandle )
3
Source/Library:
_DCTXT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_txtopen()
dc_txtopen()
Open a text file for use with Text file functions
Syntax:
Arguments:
(cFileName) is the name of the text file to open.
Returns:
A numeric file handle to be used by the other DC_TXT*()
functions.
Description:
DC_TXTOPEN() is used to open a text file for processing. The
DC_TXT*() set of functions are used to access and read the
information from text files much faster than can be
accomplished via the standard Clipper low-level file functions.
Examples:
nHandle := DC_TXTOPEN( 'dclip.sys' )
do while !dc_txteof( nHandle )
? dc_txtline( nHandle )
dc_txtskip( nHandle, 1 )
enddo
dc_txtclose( nHandle )
Source/Library:
_DCTXT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_txtclose()
dc_txtsize()
Return the size in bytes of an open text file
Syntax:
Arguments:
(nHandle) is the numeric file handle returned by DC_TXTOPEN().
Caution: This is NOT the dos file handle.
Returns:
The size of the text file in bytes.
Description:
DC_TXTSIZE() returns the size of a currently opened text file
that was opened with DC_TXTOPEN().
Examples:
nHandle := dc_txtopen( 'DCLIP.SYS' )
? DC_TXTSIZE( nHandle )
672
Source/Library:
_DCTXT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_txtopen()
dc_txtskip()
Skip a specified number of lines in a text file
Syntax:
Arguments:
(nHandle) is the numeric file handle returned by DC_TXTOPEN().
Caution: This is NOT the dos file handle.
(nLines) is the number of text lines to skip.
Description:
DC_TXTSKIP() is used to move the line pointer a specified
number of lines in a text file opened with DC_TXTOPEN().
Examples:
nHandle := dc_txtopen( 'dclip.sys' )
do while !dc_txteof( nHandle )
? dc_txtline( nHandle )
DC_TXTSKIP( nHandle, 1 )
enddo
dc_txtclose( nHandle )
Source/Library:
_DCTXT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_txtopen()
dc_txtword()
Return value of a word in a String by specifying position
Syntax:
Arguments:
(cString) is the string to search.
(nPosition) is the numerical position of the word.
(cWhiteSpace) is the character to be used as the "white
space" character. (The default is SPACE " ").
Returns:
The word corresponding to (nPosition). If (nPosition) is
greater than the number of words in (cString) then a null
will be returned.
Description:
DC_TXTWORD() returns a specified word from the numerical
position in the sentence.
Examples:
? DC_TXTWORD( 'This is a test', 2)
is
Source/Library:
_DCTXT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_token()
dc_updated()
Determine whether a GET changed during a READ
Syntax:
Arguments:
(lUpdated) if .TRUE. will set the "updated" flag. If no
parameter is passed, then only the current status will be
returned.
Returns:
.TRUE. if any GETS were updated during the read, .FALSE.
otherwise.
Description:
DC_UPDATED() determines whether characters were successfully
entered into a GET from the keyboard during the most current READ.
Each time READ executes, DC_UPDATED() is set to false (.F.). Then,
any change to a GET entered from the keyboard sets DC_UPDATED() to
true (.T.) after the user successfully exits the GET. If the user
presses Esc before exiting the first GET edited, DC_UPDATED()
remains false (.F.). Once DC_UPDATED() is set to true (.T.), it
retains this value until the next READ is executed.
Within a SET KEY or VALID procedure, you can change the current
GET variable using the KEYBOARD command or by assigning a new
value with one of the many assignment operators. Changing the
variable with KEYBOARD is the same as if the user had entered the
change directly from the keyboard, and DC_UPDATED() is set
accordingly. However, since DC_UPDATED() reflects only those
changes made from the keyboard, an assignment to the GET variable
does not affect DC_UPDATED(), therefore you should call
call DC_UPDATED(.t.) to set the updated flag.
Notes:
DC_UPDATED() works with DC_READMODAL() in the same way that
Clipper's UPDATED() works with READMODAL().
Examples:
local cCustName, cPhoneNmbr
store customer-)cust_name to cCustName
store customer-)phone_nmbr to cPhoneNmbr
@ 10,10 say 'Customer Name ' get cCustName
@ 11,10 say 'Phone Number ' get cPhoneNmbr
dc_readmodal( GetList )
IF DC_UPDATED() .and. dc_reclock()
replace cust_name with cCustName
replace phone_nmbr with cPhoneNmbr
unlock
ENDIF
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_use()
Pop up pick-list of available data files if file not found
Syntax:
Arguments:
(cFileName) is the name or wildcard of the database
file to open. If a full file name is passed, then DC_USE()
will attempt to open (cFileName). If the file cannot be found,
then the pick-list will appear. If no argument is passed then
a pick-list of all files that match the designated RDD will
appear. If a wildcard argument is passed, then all files that
match the wildcard will appear in the pick-list.
(lExclusive) if .TRUE. will open the file in EXCLUSIVE mode, if
.FALSE. (default) will open the file in SHARED mode.
(cRdd) is the name of the Replaceable data driver to use. If
no argument is given, then the currently selected default RDD
will be used.
(cAlias) is an optional alias to assign to the file.
(lNew) if .TRUE. will open the database in the first unused
work area, if .FALSE. (default) the file will be opened in the
current work area.
(lOpenFile) if .TRUE. (default) will open the database, otherwise
the database will not be opened but the filename will be returned
if the database exists.
Returns:
A character string containing the name of the file used.
Description:
DC_USE() is a user-friendly front-end to the USE command or
dbusearea() function. DC_USE() will pop-up a pick-list of
database files that match the designated RDD if the filename
passed cannot be found.
Examples:
cFileName := space(50)
@ 10,10 say ;
"enter a database to open (leave empty for pick-list)" ;
get cFileName
read
DC_USE( cFileName )
Source/Library:
_DCUSE.PRG/.OBJ, DCLIP.LIB
See Also:
USE
dc_usearea()
dc_useaindex()
Automatically open index files
Syntax:
Arguments:
(lAutoIndex) when .TRUE. will automatically open indexes,
when .FALSE. will disable the automatic index-open feature.
Returns:
A logical value equivalent to the previous settting.
Description:
DC_UseAIndex() is used to automatically open index files when using
the DBFNTX driver in the same way that a production index in
automatically opened when using the COMIX, DBFCDX or SIXCDX driver.
A new system setup variable name AUTOINDEX has been added. The
default is OFF. When set to ON then index files with the same
prefix as the Alias() and containing an index key that matches the
alias will automatically be opened with the USE command.
Examples:
Let's say the following files exist in the Default directory:
DM004.DBF
DM0041.NTX
DM0042.NTX
DM0043.NTX
They will all be opened with the following commands:
DC_UseAIndex(.t.)
USE DM004
or
SET AUTOINDEX ON
USE DM004
or
USE DM004 AUTOINDEX
Source/Library:
_DCUSE.PRG/.OBJ, DCLIP.LIB
See Also:
AUTOINDEX
dc_useall()
Opens all data files matching a specified wildcard
Syntax:
Arguments:
(cWildCard) is a wild-card argument for the database files to
open. If no argument is given, then "*" is default.
(cRdd) is the Rdd to use. If no argument is passed, then the
current Rdd will be used.
(lShared) if .TRUE. will open the databases in SHARED mode, if
.FALSE. will open the database in EXCLUSIVE mode. If no
argument is passed, then the system SET EXCLUSIVE value will be
used.
(lReadOnly) if .TRUE. will open the databases for Read
operations only, if .FALSE. (default) will open the database
for Read/Write operations.
Returns:
A logical .TRUE. if any databases were opened, a .FALSE.
if no databases were opened.
Description:
DC_USEALL() will open all database files in the SET DEFAULT
directory that match a wildcard argument. The currently
selected Data Driver (RDD) will be used. Currently selected
work areas will not be affected and if a database is already
opened, it will not be reopened. The name of the database and
the work area assigned will be displayed as each file is
opened.
Examples:
set rdd to "DBFNTX"
DC_USEALL("CUST*")
set default to \mytools\data
set rdd to "DBFSIX"
DC_USEALL()
Source/Library:
_DCUSE.PRG/.OBJ, DCLIP.LIB
See Also:
dc_usearea()
USE ALL
dc_usearea()
A front-end to dbUseArea() that tests RDD to prevent errors
Syntax:
Arguments:
(lNew) if .TRUE. will open the database in a new work area. If
.FALSE. (default), the current work area will be used.
(cRdd) is the Rdd to use. If no argument is passed, then the
(cAltRdd) will be used followed by the current Rdd.
(cDatabase) is the name of the file to open. If no drive and
directory is included then the file must exist in the SET
DEFAULT directory or SET PATH directory.
(lShared) if .TRUE. will open the database in SHARED mode, if
.FALSE. will open the database in EXCLUSIVE mode. If no
argument is passed, then the system SET EXCLUSIVE value will be
used.
(lReadOnly) if .TRUE. will open the database for Read
operations only, if .FALSE. (default) will open the database
for Read/Write operations.
(cAlias) is the ALIAS to assign to the work area. If no
argument is passed then the prefix of the database name will
be used as the alias.
(lDisplayError) if .TRUE. (default) will display an error window
if the file could not be opened.
(lBreak) if .TRUE. will BREAK after an error rather than RETURN.
The default is .FALSE.
@(lError) is a logical parameter, passed by reference. If an
error occurs this variable will be set to .TRUE., otherwise it
will be set to .FALSE.
(lCMXAutoOpen) is used to override the "auto-open" feature of the
"COMIX" and "FORTRESS" data drivers. Passing a .FALSE. (default
is .TRUE) will force the COMIX/FORTRESS driver to NOT open any
associated *.CDX index file.
(cAltRdd) is an alternate RDD to use if the database cannot be
opened by the primary (cRdd) driver.
Returns:
NIL
Description:
DC_USEAREA() is a front-end to the Clipper dbusearea() function
that can be used as a replacement for opening databases. This
function tests the validity of a database and it's associated
memo file (if it exists) before attempting to open it to
prevent common errors. Working with different database drivers
can make it difficult to determine the cause of an open error.
This function is designed to test a database to make sure it is
a proper type. Parameters passed to DC_USEAREA() are identical
to dbusearea() so this function can be used as a replacement.
Examples:
DC_USEAREA ( .t., 'DBFMDX', 'CUSTOMER',, .t., .f. )
Source/Library:
_DCUSE.PRG/.OBJ, DCLIP.LIB
See Also:
USE
dc_use()
dc_dbfile()
dc_useraccess()
Determine if Logged-On user has access to a lock
Syntax:
Arguments:
(cLockCode) is a 3-character "Lock" code.
(cErrorMsg) is the message to display if the user does not
have posession of the key to the specified lock or a master
key. If this parameter is not passed, then a default message
will be displayed.
Returns:
A logical .TRUE. if the user possesses a key to the specified
lock, .FALSE. otherwise.
Description:
DC_USERACCESS() is used to established whether or not the
logged-on user has possession of a key to a specified lock.
If NO user has logged on with DC_USERLOGON() or the
logged-on user is a programmer or the logged-on user has
been assigned "no keys" then a logical .TRUE. will always be
returned.
Examples:
#include 'dcuser.ch'
DC_UserLogon( 'CURLY' )
-- Example 1 --
IF !DC_USERACCESS( '511', "Sorry. You can't use this menu!" )
RETURN
ENDIF
DC_MenuRun('MENU511')
Source/Library:
_DCUSER.PRG/.OBJ, DCLIP.LIB
dc_userfree()
Free the lock on the the User file to allow user access
Syntax:
Arguments:
None
Returns:
Nil
Description:
DC_USERFREE() is used to remove the lock on the DCUSERS.DBF
database that was previously used to lock out all users.
Examples:
DC_USERFREE()
Source/Library:
_DCUSER.PRG/.OBJ, DCLIP.LIB
See Also:
dc_userlock()
dc_userinfo()
Get or Set information about Logged-On User
Syntax:
Arguments:
(nElement) is the array item to return. If the (nElement)
argument is not passed then the entire array will be returned.
(xValue) is the value to store in aUserInfo[(nElement)].
Returns:
An array if (nElement) is not passed or a value dependent on
the value of (nElement).
The array consists of 15 elements (See DCUSER.CH) for
array definitions:
Element Type Description
------- ---- -------------------------------------------
[1] C USER_ID - User ID code
[2] C USER_NAME - User Name
[3] C USER_KEYS - User Keys (separated by commas)
[4] C USER_MASTERPASS - Master Password
[5] L USER_PROGRAMMER - "Programmer" flag
[6] C USER_PASSWORD - Logged On User Password
[7] C USER_MENU - User Start Menu Name
[8] C USER_WPNAME - User Word Processor
[9] C USER_WPPARAM - User Word Processor parameters
[10] C USER_WPPATH - User Word Processor directory
[11] C USER_GROUP - User Group
[12] L USER_MAILFLAG - Mail Flag
[13] L USER_PHONEFLAG - Phone message Flag
[14] L USER_COLOR - Set Color ON Flag
[15] C USER_PRINTER - User Printer Name
Description:
DC_USERINFO() is used to set or get information about the
logged-on user. This array is built when the user logs on
with DC_UserLogOn() or DC_UserSet().
Examples:
#include 'dcuser.ch'
DC_UserLogon( 'LARRY' )
-- Example 1 --
? DC_USERINFO( USER_ID )
LARRY
-- Example 2 --
/* -- Give user temporary access to all menus -- */
DC_USERINFO( USER_KEYS, '' )
-- Example 3 --
? DC_USERINFO()[ USER_KEYS ]
1**,2**,31*,320,321,4**
Source/Library:
_DCUSER.PRG/.OBJ, DCLIP.LIB
See Also:
dc_usermaint()
dc_userlock()
Lock or attempt to lock all users out of the system
Syntax:
Arguments:
(aErrorMsg) is an array of character strings to display as
the message in the event that the DCUSER.DBF database cannot
be locked. If this argument is not passed, then a default
message will be displayed.
Returns:
A logical .TRUE. if the file was locked successfully, .FALSE.
otherwise.
Description:
DC_USERLOCK() is used to lock or attempt to lock the DCUSER.DBF
database to prevent users from logging onto the system for
maintenance purposes. This function will attempt to lock the
file first. If other users are on the system, then the file
cannot be locked and a list of logged on users will be
displayed in the error message window.
Examples:
? DC_USERLOCK()
.f.
Source/Library:
_DCUSER.PRG/.OBJ, DCLIP.LIB
See Also:
dc_userfree()
dc_userlogin()
Log On to system to establish user rights
Syntax:
Arguments:
(cUserID) is the User ID of the logging on user. If this
parameter IS NOT passed and the (cPassword) parameter IS
passed, then the DCUSER.DBF will be searched only for a
match to the (cPassword). If (cUserID) is passed and
(cPassword) is not passed, then the user will be prompted to
enter a password. If neither (cUserID) or (cPassword) is
passed, then the user will be prompted for both a User ID
and a password.
Returns:
A logical .TRUE. if the user logs on successfully, .FALSE.
otherwise.
Description:
DC_USERLOGON() is used to log a user onto the system in the
event that it is necessary to establish rights to menus,
files, or specified fields.
The dCLIP menu system, data-entry (editing) system, browsing
system, and file system provide for establishing locks on
menu items, fields and/or files. If these systems are used
without first calling DC_USERLOGON(), then the user will be
given full rights. If however, DC_USERLOGON() is called
first, then the user will be given access to only those
items in which the user has the exact key or a master key
for each specified lock.
If the user logs on with the MASTER PASSWORD, then he/she is
automatically established as a "programmer" and is given full
access. The MASTER PASSWORD is hard-coded by a definition in
DCUSER.CH. To change the MASTER PASSWORD you must redefine it
in DCUSER.CH and then recompile _DCUSER.DBF and include the
new _DCUSER.OBJ in your link-script.
User PASSWORDS are stored in the DCUSER.DBF database in
encrypted form. Passwords may be assigned or changed only
with the DC_USERMAINT() function or the USER EDIT command.
User KEYS are stored in the DCUSER.DBF database and may be
assigned or changed only with the DC_USERMAINT() function or
the USER EDIT command. Locks are placed on menu items or
fields by entering a 3-character "lock" sequence when using
the menu-designer and/or data-entry designer. A database of
standard locks and their definitions may be maintained by
DC_LOCKMAINT(). When assigning a user a set of "keys" they
may be specific keys or "master" keys. A Master key is
assigned by using wild-cards. For example, the Master Key
"5**" will allow access to any lock starting with the number
"5", whereas the Master Key "67*" will allow access to any
lock with the number "67". Keys are stored in the USR_KEYS
field and are separated by commas.
Example:
"1**,2**,3**,41*,42*,522,6**"
Examples:
#include 'dcuser.ch'
DC_USERLOGON( 'LARRY' )
Source/Library:
_DCUSER.PRG/.OBJ, DCLIP.LIB
See Also:
dc_usermaint()
dc_usermaint()
Maintain the DCUSER.DBF User database
Syntax:
Arguments:
If the (cUserID) argument is passed, then the record that
contains the USR_ID matching (cUserID) will be edited,
otherwise all records will be available for browsing and
editing.
Returns:
A logical .TRUE. if the user database was opened and accessed,
.FALSE. otherwise.
Description:
DC_USERMAINT() is used to maintain the DCUSER.DBF database
for establishing User ID's, Names, Passwords, Access Keys,
etc.
Examples:
#include 'dcuser.ch'
-- Example 1 --
DC_USERMAINT( 'LARRY' )
-- Example 2 --
DC_USERMAINT()
Source/Library:
_DCUSER.PRG/.OBJ, DCLIP.LIB
dc_useropen()
Open the DCUSER.DBF User database
Syntax:
Arguments:
(cTagName) is the Tag Name of the Index to select.
If no parameter is passed then USR_ID is the default.
Tag Name Description
-------- ------------------------------------------
USR_ID USR_ID
DEPT USR_DEPT + USR_ID
JOB USR_JOB + USR_DEPT + USR_ID
Returns:
A logical .TRUE. if the user database was opened successfully,
.FALSE. otherwise.
Description:
DC_USEROPEN() is used to open the DCUSER.DBF database or
to select is for use if it is already open.
Source/Library:
_DCUSER.PRG/.OBJ, DCLIP.LIB
dc_userset()
Establish the Logged-On user from the User Database
Syntax:
Arguments:
(cUserID) is a valid user id that matches the value in the
USR_ID field of the DCUSER.DBF database.
Returns:
A logical .TRUE. if the User ID was found in the database,
.FALSE. otherwise.
Description:
DC_USERSET() is used to load the logged-on user array from
a specifed record in the DCUSER.DBF database.
Examples:
DC_USERSET( 'MOE' )
Source/Library:
_DCUSER.PRG/.OBJ, DCLIP.LIB
See Also:
dc_userinfo()
dc_util()
A menu-driven set of database utilities
Syntax:
Arguments:
(cCode) is a single character designating the utility program
to run. If no argument is passed then a user-menu will be
displayed.
cCode Utility program
----- -------------------
C Create Database
D Display Structure
O mOdify Structure
S Copy Structure
A Append Records
P coPy Records
M iMport a Data File
R Replace Data
Y copY Fields
E dElete Records
L RecaLL Records
T SorT Database
J Join with Database
N CouNt Records
U sUm Data Fields
V aVerage Data Fields
K disK Directory
I Insert Blank Record(s)
B Pack DataBase
Z Zap Database
X Import/eXport Memos
G PurGe Duplicate Records
Returns:
A character equivalent to the code letter for the utility
program selected an run by the user.
Description:
DC_UTIL() provides a set of general-purpose database utilities
to perform menu-driven, complex database operations on the
currently selected work area.
Examples:
do while lastkey()#27
cls
@ 10,10 prompt "open a database"
@ 11,10 prompt "open an index file"
@ 12,10 prompt "database utilities"
@ 13,10 prompt "browse database"
menu to nChoice
do case
case nChoice = 1
dc_dbfopen()
case nChoice = 2
dc_ntxopen()
case nChoice = 3
DC_UTIL()
case nChoice = 4
dc_browsedb()
endcase
enddo
Source/Library:
_DCUTIL.PRG/.OBJ, DCLIP.LIB
See Also:
UTIL
dc_valtype()
Validate input parameters and set default values
Syntax:
Arguments:
(cMemVar) is the memory variable to validate.
(xDefaultVal) is the value to initialize (cMemVar) if the
(cMemVar) is not the same type as (xDefaultVal).
Returns:
NIL
Description:
DC_VALTYPE() is a handy way of validating paramters that
are passed to functions and filling them with default
values if the parameter is not passed or if the wrong
type of parameter is passed.
Notes:
DC_VALTYPE() supports type-checking on up to 15 variables.
If you need to validate more than 15 variables, then call
DC_VALTYPE() a second time with the remaining variables.
Examples:
function window ( nStRow, nStCol, nEnRow, nEnCol, cTitle )
DC_VALTYPE( @nStRow, 0, @nStCol, 0, @nEnRow, MaxRow(), ;
@nEnCol, MaxCol(), @cTitle, "" )
return dc_expl( nStRow, nStCol, nEnRow, nEnCol, cTitle )
Source/Library:
_DCVAL.PRG/.OBJ, DCLIP.LIB
dc_version()
Returns current dCLIP version
Syntax:
Arguments:
NONE
Returns:
A character string.
Description:
DC_VERSION() will return the current version of the dCLIP
libraries.
Examples:
? DC_VERSION()
3.00
Source/Library:
_DCVERS.PRG/.OBJ, DCLIP.LIB
dc_viewlib()
Browse status of loaded dynamic libraries and .obj files
Syntax:
Arguments:
(lObjList) if .TRUE. will list only the .OBJ files currently
"dynamic-linked" into memory. If .FALSE. (default), then a
browse-style menu will appear with information about .OBJ's and
modules that are "dynamic-linked" and dynamic-libararies that
are loaded.
Returns:
NIL
Description:
DC_VIEWLIB() will display a browse-style menu for viewing the
contents of dynamic libraries and loaded object modules.
I Numbers below this header are index numbers into the total
dynamic library space. You can think of this as an object
record number.
L An "L" will appear in this column if the object is currently
loaded into memory.
C A "C" will appear in this column if the object is changed.
When C displays, the version of the object loaded from disk
is more current that the one in the dynamic library.
U This shows the USAGE of the object. 0 indicates the object
is not linked. 1 indicates that the object is linked, but
not in use. 2 or a higher number shows that the object is
being used and is not available for release.
TYPE This shows the type of the object. Object types are:
OBJ - compiled programs
LST - function and procedure locations
NAM - library header
NAME This contains the name of the object.
DATE This shows the creation or last change date for the
selected object in month/day/year format.
TIME This shows the time of creation or last change for the
selected object.
F The number in this column tells which dynamic library the
object currently resides in. You can think of this as a
"file" number.
LEN The length of the object displays in LEN field. The
number in this field shows the total number of bytes
contained in the object.
E Some objects contain multiple object records which form
parts of screens, reports, etc. E shows how many
different object records or elements the object contains.
Examples:
do while lastkey()#27
cls
@ 10,10 prompt "load a dynamic library"
@ 11,10 prompt "run a program"
@ 12,10 prompt "view dynamic link status"
menu to nChoice
do case
case nChoice = 1
accept "enter dynamic library to load" to cDlb
dc_libload( cDlb )
case nChoice = 2
accept "enter program to run" to cProgram
dc_do( cProgram )
case nChoice = 3
DC_VIEWLIB()
endcase
enddo
Source/Library:
_DCVLIB.PRG/.OBJ, DCLIP.LIB
See Also:
VIEW LIB
dc_virtcapture()
Capture the current record to the Virtual record
Syntax:
Arguments:
If (lFieldNames) is a logical .TRUE., then the field name data
will be saved in the array returned. DC_VIRTREPLACE() will
automatically know if the field data information is in the array
and will not cause an error if the structure of the target
database is not the same as the structure of the primary database.
IF (lFieldNames) is .FALSE., then the target database must
exactly match the structure of the primary database.
Returns:
If (lFieldNames) is .TRUE., returns single-dimensional array with
a number of elements equal to the number of fields in the
current database.
If (lFieldNames) is .FALSE., returns a multi-dimensional array
of two elements: The first is an array of field names, the
second is an array of data.
Description:
DC_VIRTCAPTURE() is used to capture the data in all fields of
the current database to a VIRTUAL record array to be used with
other DC_VIRT*() functions.
Examples:
aVirtual := nil
do while lastkey()#27
cls
@ 10,10 prompt "capture current record to virtual"
@ 11,10 prompt "select a record"
if valtype(aVirtual)='A'
@ 12,10 prompt "replace current record with virtual"
endif
menu to nChoice
do case
case nChoice = 1
aVirtual := DC_VIRTCAPTURE()
case nChoice = 2
dc_dbchoice()
case nChoice = 3
dc_virtreplace( aVirtual )
endcase
enddo
Source/Library:
_DCVIRT.PRG./.OBJ, DCLIP.LIB
See Also:
dc_virtreplace()
dc_virtreplace()
Replace the current record with the Virtual record
Syntax:
Arguments:
(aVirtualRecord) is a virtual record array saved by
DC_VIRTSAVE().
Returns:
A logical .TRUE. if the data replacement is successful, .FALSE.
otherwise.
Description:
DC_VIRTREPLACE() will replace the contents of the current
record with the data in the virtual record. This function will
automatically handle the record locking, so it is not necessary
to lock the record.
Examples:
aVirtual := nil
do while lastkey()#27
cls
@ 10,10 prompt "capture current record to virtual"
@ 11,10 prompt "select a record"
if valtype(aVirtual)='A'
@ 12,10 prompt "replace current record with virtual"
endif
menu to nChoice
do case
case nChoice = 1
aVirtual := dc_virtcapture()
case nChoice = 2
dc_dbchoice()
case nChoice = 3
DC_VIRTREPLACE( aVirtual )
endcase
enddo
Source/Library:
_DCVIRT.PRG./.OBJ, DCLIP.LIB
See Also:
dc_virtcapture()
dc_virtrestore()
Restore Virtual record from Virtual (.DCV) file
Syntax:
Arguments:
NONE
Returns:
An array with the contents of the .DCV file.
Description:
DC_VIRTRESTORE() will create a virtual record array from the
contents of a virtual record (.DCV) file which was created with
the DC_VIRTSAVE() function.
Examples:
// this routine will append 5 records to the current database
// that will be filled in with data from the virtual record.
aVirtual := DC_VIRTRESTORE()
if valtype(aVirtual) = 'A'
for i := 1 to 5
dc_addrec()
dc_virtreplace( aVirtual )
next
endif
Source/Library:
_DCVIRT.PRG./.OBJ, DCLIP.LIB
See Also:
dc_virtsave()
dc_virtsave()
Save Virtual record to Virtual (.DCV) file
Syntax:
Arguments:
(aVirtualRecord) is a virtual record array saved by
DC_VIRTSAVE(). If no argument is passed, then the contents of
the current record in the current work area will be used as the
virtual record.
Description:
DC_VIRTSAVE() will save the contents of a virtual record array
or the current database record to a virtual record (.DCV) file.
The file will have the same name as the current database file
name except it will have the .DCV extension, and will be
located in the same directory as the database file.
A virtual record can be used as a "data template" for multiple
purposes:
1. To fill in default data when appending a new record.
2. To be used to cut and paste data from one record to
another.
Source/Library:
_DCVIRT.PRG./.OBJ, DCLIP.LIB
See Also:
dc_virtrestore()
dc_wait()
A mouseable wait-state that clears message line
Syntax:
Arguments:
(cMessage) is the message to display.
Description:
DC_WAIT() functions identically to the Clipper WAIT command or
__wait() function except that it clears the message line
afterwards. This function is used for procedures that scroll
information up the screen and a user-prompt is required to
press any key after each screen is displayed.
A mouse event (key-click) will stuff the keyboard with -29 to
clear the wait state.
Examples:
nHandle := dc_txtopen( '\clipper5\include\std.ch' )
nLine := 0
do while !dc_feof( nHandle ) .and. lastkey()#27
? dc_txtline( nHandle )
dc_txtskip( nHandle, 1 )
nLine++
if nLine ) maxrow()-3
DC_WAIT( "Press any key to continue, Escape to Abort")
nLine := 0
endif
enddo
dc_txtclose( nHandle )
Source/Library:
_DCWAIT.PRG/.OBJ, DCLIP.LIB
dc_waiton()
Display a "Wait" Message in a window to restore later
Syntax:
Arguments:
(cMessage) is the message to place in the window. If this
is passed as an array, then each element must be a character
string representing each line of text in the window. If no
argument is passed then the following default message will
be displayed: "Please wait..."
(lSound) if .TRUE. will create a warning tone. .FALSE. is
default.
(cColor1) is the color of the window frame. If no argument
is passed then the system color for "exploding box frame" will
be used.
(cColor2) is the color of the window contents. If no
argument is passed then the system color for "exploding box
contents" will be used.
(nTop) is the top display row of the message box. If no
argument is passed, then the box will be vertically positioned
in the center of the screen.
(nLeft) is the left display column of the message box. If no
argument is passed, then the box will be horizontally
positioned in the center of the screen.
Returns:
A character string that is a "composite" of the coordinates,
colors, etc. to be used later to restore the screen with DC_IMPL().
Description:
DC_WAITON() is used to explode a "waiting" type message box
on the screen to later be imploded with DC_IMPLODE() or
DC_IMPL(). This is a handy function to display a message box
when the system is busy performing time-consuming operations
such as printing, copying, packing, loading, etc.
Notes:
Use DC_EXPLMODE(.f.) to disable the exploding process when you
want screens to display "instantly" instead of "explode".
This is particularly useful when running the application on a
slower computer.
Use DC_ALTSHADOW(.t.) to display the shadow on the right
side of the box.
Examples:
aMessage := { 'Now Printing Calendar',;
'',;
'Press ESCAPE to Abort' }
cSaveScrn := DC_WAITON( aMessage )
do while !eof() .and. inkey(.5)#K_ESC
* Do some stuff
enddo
DC_Implode(cSaveScrn)
Source/Library:
_DCEXPL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_impl()
dc_explode()
dc_implode()
dc_watch()
Load / clear an expression to / from the Watch table
Syntax:
Arguments:
(cExpression) is an expression to evaluate. This expression
may include database fields, private variables, and public
variables. (cExpression) may also be the name of Local or
Static variables provided that the Local or Static variable
name is not included in a complex expression.
(lClear) will clear a specified expression from the watch
table.
(nNumber) is the number of the watch expression to clear from
the watch table. The watch table is treated like a "stack" so
after an expression is cleared, all other expressions will be
pushed down the stack. If nNumber is 0 and lClear is .TRUE.
then ALL expressions will be cleared from the watch table.
NOTE - If NO ARGUMENTS are passed, then DC_WATCH() will display
the current status of the watch table.
Returns:
NIL
Description:
DC_WATCH() is used to add to, clear from, or display the
contents of the "watch" table. The watch table is an array of
expressions that are evaluated and the output is displayed in a
window after each line of code is executed when source-level
debugging or at the dot prompt.
Examples:
-- Example 1 -- Adding expressions to the watch table
DC_WATCH( 'RECNO()' )
DC_WATCH( 'ALIAS()' )
-- Example 2 -- Clearing an expression from the watch table
DC_WATCH( , .t., 2 ) // Clear expression #2
-- Example 3 -- Clearing the entire expression table
DC_WATCH( , .t., 0 ) // Clear ALL
-- Example 4 -- Displaying contents of watch table
DC_WATCH()
Source/Library:
_DCWATCH.PRG/.OBJ, DCLIP.LIB
dc_watchdisp()
Evaluate Watch Table and display results
Syntax:
Arguments:
(nStrow) is the start display row.
(nStcol) is the start display column.
(nEnrow) is the end display row.
(nEncol) is the end display column.
Returns:
nil
Description:
DC_WATCHDISP() is used to display the results of all the
expressions that are loaded into the watch table array in a
display window.
Examples:
// load watch table with expressions to evaluate
dc_watchtable( {'RECNO()','INDEXKEY(0)','ALIAS()','EOF()'} )
DC_WATCHDISP( 10,5,15,75 ) // display expressions
Source/Library:
_DCWATCH.PRG/.OBJ, DCLIP.LIB
See Also:
dc_watch()
WATCH
dc_watchtable()
Return the watch table array
Syntax:
Arguments:
(aWatchTable) is an array of character-string expressions to
evaluate.
Returns:
An array of character strings equivalent to the expressions that
have been loaded into the watch table using the DC_WATCH()
function or WATCH command.
Description:
DC_WATCHTABLE() is used to load the watch table or return the
current contents of the watch table for later evaluating with
DC_WATCHDISP() or the source-level debugger.
Examples:
// This example shows how the display of watch expressions
// can be manipulated at the dot prompt.
. aWatch := { 'TIME()','DATE()','ALIAS()','RECNO()' }
. define WATCHON DC_WATCHTABLE( aWatch )
. define WATCHOFF DC_WATCHTABLE( {} )
. WATCHON // turn on watch window
. WATCHOFF // turn off watch window
Source/Library:
_DCWATCH.PRG/.OBJ, DCLIP.LIB
See Also:
dc_watch()
WATCH
dc_word2num()
Convert a 2-byte word to a number
Syntax:
Arguments:
(cByteString) is a 2-byte character string.
Returns:
An integer number.
Description:
DC_WORD2NUM() is used to convert a 2-byte word to an integer.
Examples:
The following example shows how to use DC_NUM2WORD() and
DC_WORD2NUM() to save numeric values to a file and restore
them.
FUNCTION savenumbers ( aNumbers )
// aNumbers := { 10, 45, 134, 678, 3, 200 }
nHandle := fcreate( 'numbers.bin' )
for i := 1 to len(aNumbers)
fwrite( nHandle, DC_NUM2WORD( aNumbers[i] )
next
fclose( nHandle )
return
FUNCTION restnumbers
local nHandle := fopen( 'numbers.bin' )
local aNumbers := {}
aadd( aNumbers, DC_WORD2NUM( freadstr( nHandle, 2 ) ) )
fclose( nHandle )
return aNumbers
Source/Library:
_DCNUM.PBG/.OBJ, DCLIP.LIB
See Also:
dc_num2word()
dc_work()
A work area file (*.DCW) manager
Syntax:
Arguments:
NONE
Returns:
nil
Description:
DC_WORK() will invoke a .DCW manager for creating, editing
or saving .DCW files. A .DCW (Work) file is used to save
the status of all open work areas for later restoring.
Examples:
DC_WORK()
Source/Library:
_DCWORK.PRG/.OBJ, DCLIP.LIB
See Also:
dc_worksave()
dc_workarray()
Capture all information about a work area to an array
Syntax:
Arguments:
(nArea) is the work area. If no argument is passed, then the
current work area will be used.
Returns:
A multi-dimensional array described as follows:
Element Type Description
------- --------- ------------------------------------------
1 Numeric I dunno...a bunch of numbers of some sort
2 Numeric Number of fields
3 Logical At Beginning of file?
4 Logical At End of file?
5 Logical Did last SEEK find a match?
6 Character Search String for last LOCATE
7 Character Current filter condition
8 Numeric Number of Child Relations
9 Numeric Length of record
10 Numeric Number of records
11 Numeric Current record number
12 Numeric File handle of DBF
13 Logical Does this DBF have a DBT file?
14 Numeric File handle of DBT
15 Logical Was DBF opened in SHARED mode?
16 Logical Was DBF opened in READONLY mode?
17 Logical Is the DBF File locked?
18 Logical Is the current record locked?
19 Numeric Record number of locked record
20 Numeric Index order
21 Numeric Index count
22 Array Numeric - File handle of each Index file
23 Array Character - field Names
24 Array Character - field Type
25 Array Numeric - field Length
26 Array Numeric - field Decimal
Description:
DC_WORKARRAY() returns a multi-dimensional array that is a
snapshot of a work area object. This array will have
information about the work area that is not provided by any
Clipper functions, i.e, file handles, lock status, etc.
Examples:
set default to \customer\data
use customer via 'DBFSIX' index custname, custnmbr
aWorkData := DC_WORKARRAY()
// display database name
? dc_hand2name( aWorkData[12] )
\CUSTOMER\DATA\CUSTOMER.DBF
// display memo name
? dc_hand2name( aWorkData[14] )
\CUSTOMER\DATA\CUSTOMER.FPT
// display index file name(s)
? dc_hand2name( aWorkData[22,1] )
\CUSTOMER\DATA\CUSTNAME.IDX
? dc_hand2name( aWorkData[22,2] )
\CUSTOMER\DATA\CUSTNMBR.IDX
Source/Library:
_DCAREA.PRG/.OBJ, DCLIP.LIB
dc_workbrow()
Browse a Work Area (*.DCW) dictionary file
Syntax:
Arguments:
(cWorkFile) is the name of the Work File to browse. If no
extension is given then .DCW is assumed. If no argument is
passed, then a window will appear to request the name of
the .DCW file from the user.
Description:
DC_WORKBROW() is used to browse a .DCW (Work) file. This
function is used to create a new .DCW file or to modify an
existing .DCW file that was created with the DC_WORKSAVE()
function.
Notes:
See the separate section titled WORK SYSTEM for more
information.
Examples:
use customer
use invoice new index custnmbr
use invitems new index invnmbr
sele customer
set relation to cust_nmbr into invoice
sele invoice
set relation to inv_nmbr into invext
browse tile
save work to customer
DC_WORKBROW('CUSTOMER')
Source/Library:
_DCWORK.PRG/.OBJ, DCLIP.LIB
See Also:
dc_worksave()
dc_working()
Display a "Working in Progress" bar
Syntax:
Arguments:
(nMode) is a number 0,1, or 2 depending on the function
desired:
0 - Initialize Static values and display bullet
1 - Paint new bullet if timer exceeded
2 - Terminate and restore screen
(cTitle) is the message to display in the box. If no
parameter is passed then "Working" will be displayed.
(nStRow) is the start display row. This parameter is used
only if (nMode) is 0.
(nStCol) is the start display column. This parameter is used
only if (nMode) is 0.
(nEnCol) is the end display column. This parameter is used
only if (nMode) is 0.
(lBox) if .TRUE. (default) will paint a box around the progress
bar starting at the passed coordinates, otherwise the progress
bar only will be painted starting at the passed coordinates.
(cColors) is a character string containing 2 color specfications
separated by a comma. The first color is the color of the box,
the second is the color of the progress bullets. If no parameter
is passed, then the current system color will be used for both
colors.
(nUpdate) is the amount of time (in seconds) to wait before
painting the next bullet. Default value is .3 seconds.
Returns:
Nil
Description:
DC_WORKING() is used to display "Working" progress bullets
for displaying the progress of any operation. The progress
bullets which will fill in the specified area.
Examples:
DC_WORKING( 0,'Deleting records ')
dbSetOrder(0)
go top
do while !Eof()
DC_WORKING( 1 )
dbDelete()
SKIP
enddo
DC_WORKING( 2 )
Source/Library:
_DCODD2.PRG/.OBJ,DCLIP.LIB
See Also:
dc_progress()
dc_odometer()
dc_odblock()
dc_workrestore()
Restore work areas, indexes, relations, etc from a work file
Syntax:
Arguments:
(cWorkFile) is the name of a work file which was previously
created by the SAVE WORK command. If no extension is given
then .DCW is assumed.
(lAdditive) is an optional clause which will insure that
currently used work areas are not affected. If a database is
already opened in a work area, it will not be reopened in a new
work area. If the (lAdditive) parameter is not passed, then
all work areas will be closed before restoring the old work.
(lVerbose) if .TRUE. (default) will display information about
each work area as it is being restored from the .DCW file. If
.FALSE. then nothing will be displayed.
(lWait) if .TRUE. will pause after restoring all the work areas
so the operator may view the screen of information. If
(lVerbose) is .FALSE., then (lWait) is ignored.
(lExcl) if .TRUE. will override the settings in the DCFILES.DBF
file for the file group and open the files EXCLUSIVE. If the
parameter is not passed or is .FALSE., then files will be
opened in the default mode.
(cTagName) if passed as a character string or numeric value will
override the tag name or index order in the DCFILES.DBF file
group.
Returns:
NIL
Description:
DC_WORKRESTORE() is used to restore a complete work area
environment from a .DCW work file created with the SAVE WORK
command or DC_WORKSAVE() function. This function will
accomplish the following:
* Re-open all databases, using the required RDD (Replaceable
Data Driver).
* Open all indexes or rebuild indexes that don't exist or have
not been properly updated.
* Set parent-child relations.
* Restore record, index and tag pointers.
* Restore browse windows.
* Restore filters.
* Restore Database environment such as PATH, DEFAULT, UNIQUE,
etc.
Examples:
use maillist via 'DBFSIX"
index on zip tag zip
index on phone tag phones
use customer via 'DBFSIX' new index custnmbr
use invoice via 'DBFSIX' new index invoice
set relation to cust_nmbr into customer
dc_browtile( 3 )
dc_worksave( 'MYWORK' )
close all
DC_WORKRESTORE( 'MYWORK' )
Source/Library:
_DCWORK.PRG/.OBJ, DCLIP.LIB
See Also:
RESTORE WORK
dc_worksave()
SAVE WORK
dc_worksave()
Save all info about all work areas to a WORK (*.DCW) file
Syntax:
Arguments:
(cWorkFile) is the name of a work file to create. If no
extension is given then .DCW is assumed. The work file created
will have the same structure as a .DBF database file and can be
edited or browsed at any time with standard database commands.
(cTitle) is the title name to assign to the work file.
(lVerbose) if .TRUE. (default) will display information about
each work area saved as it is being written to the .DCW file.
If .FALSE. then nothing will be displayed.
Returns:
A logical .TRUE. if the environment is saved with no errors,
.FALSE. otherwise.
Description:
DC_WORKSAVE() is used to save a complete work area environment
to be restored later with DC_WORKRESTORE().
This will accomplish the following:
* Save the names and paths of all databases, including the RDD
(Replaceable Data Driver).
* Save information about all tags and index so they can be
re-built if they become corrupted or deleted.
* Save parent-child relations.
* Save record, index and tag pointers.
* Save browse window arrays.
* Save filters.
* Save Database environment such as PATH, DEFAULT, UNIQUE, etc.
Examples:
use maillist via 'DBFSIX"
index on zip tag zip
index on phone tag phones
use customer via 'DBFSIX' new index custnmbr
use invoice via 'DBFSIX' new index invoice
set relation to cust_nmbr into customer
dc_browtile( 3 )
DC_WORKSAVE( 'MYWORK' )
close all
dc_workrestore( 'MYWORK' )
Source/Library:
_DCWORK.PRG/.OBJ, DCLIP.LIB
See Also:
SAVE WORK
dc_workrestore()
dc_fileedit()
dc_xorbits()
Logical EXCLUSIVE OR of two integers
Syntax:
Arguments:
(nInteger1) and (nInteger2) are any integers between 0 and 255.
Description:
DC_XORBITS() produces a logical EXCLUSIVE OR of two integers.
Examples:
? DC_XorBits( 0, 1 )
1
? DC_XorBits( 1, 1 )
1
? DC_XorBits( 100, 99 )
7
Source/Library:
_DCAND.PBG/.OBJ, DCLIP.LIB
See Also:
dc_andbits()
dc_xtoc()
Convert any variable type to a character string
Syntax:
Arguments:
(xValue) is any variable or database field.
Returns:
A character string.
Description:
DC_XTOC() converts any variable to a character string.
Examples:
? DC_XTOC( nil )
Nil
? DC_XTOC( { 0,1,2 } )
{...}
Source/Library:
_DCVAL.PRG/.OBJ, DCLIP.LIB
dc_yesno()
Display a YES / NO message box menu
Syntax:
Arguments:
(nStartRow) is the starting screen row.
(nStartCol) is the starting screen column.
If no coordinates are given, then the message box will be
displayed in the middle of the screen.
(nChoice) : 1 will default to YES (default), 2 will default
to NO.
(lNoBox) - If .TRUE. will not display a box around the menu
choices. If .FALSE. (default) a box will be displayed.
Returns:
A logical .TRUE. if the user chose "Yes". A logical false
if the user chose "No" or pressed Escape.
Description:
DC_YESNO() is used to display a menu with two choices:
"Yes" or "No".
Examples:
? DC_YESNO()
.f. // operator chose "No"
Source/Library:
_DCMSG.PRG/.OBJ, DCLIP.LIB
See Also:
dc_msgbox()
dc_zap()
Zap the database with the proper operator prompts
Syntax:
Description:
DC_ZAP() is a high-level function that will ZAP the database in
the currently selected work area after prompting the user.
Examples:
do while .t.
@ 10,10 prompt "open a database"
@ 11,10 prompt "browse database"
@ 12,10 prompt "zap database"
menu to nChoice
do case
case nChoice = 1
dc_dbfopen()
case nChoice = 2
dc_browsedb()
case nChoice = 3
DC_ZAP()
endcase
enddo
Source/Library:
_DCDBPK.PRG/.OBJ, DCLIP.LIB
See Also:
ZAP
UTIL
dc_util()