dc_e()...............Determine if DC_EDITDB() is running.
dc_edit() *.........Full-screen record editor (obsolete)
dc_edit2()...........A function for calling edit-system sub-routines
dc_editappend()......Determine if the user is currently appending a new record
dc_editarest().......Restore a data-entry editing configuration array
dc_editasave().......Save the edit array object for a selected work area
dc_editcnd().........Post an array of fields to edit
dc_editconfig()......Define the system editor
dc_editdb()..........Invoke a multi-window full-screen edit of all work areas
dc_editdel().........Delete an Edit configuration in the Edit Dictionary
dc_editfile()........Pop-up a user-prompt menu to edit an ASCII file
dc_editflag()........Set or Get specific information about an edit object
dc_editload()........Load an editing array from edit dictionary or array file
dc_editlocal().......Allows GET/SET access to the Local array in DC_EDITDB()
dc_editmenu()........Restore an Edit Menu from an Array or Data-Dictionary
dc_editmode()........Set the default mode for tile-editing
dc_editpick()........Pick an editing configuration from the edit dictionary
dc_editprg().........Edit a .PRG source-code file
dc_editrec().........Pop-up a record editing window
dc_editrestore().....Restore and execute an Editing configuration from an array
dc_editrev().........Enable automatic updated of revision fields
dc_editsave()........Save a data-entry array to dictionary, array file or source code
dc_editsource()......Write Multiple-Window Editing configuration to source code
dc_editstru()........Edit the dCLIP structure-extended database
dc_edittile()........Invoke set of edit windows for specified list of work areas
dc_editwhen()........Post an array of fields to edit
dc_encrypt().........Encrypt a character string or number
dc_envirrest().......Restore the Clipper environment from an array or file
dc_envirsave().......Save the entire Clipper environment to an array or file
dc_erase()...........Pop-up a user-prompt menu for erasing a file
dc_error()...........The dCLIP error handler
dc_errormsg()........Display an array of error messages in a window
dc_execute().........Execute a function based on passed parameters
dc_expl()............Explode a window with pre-defined colors
dc_explmode()........Enable/Disable exploding windows
dc_explode().........Explode a window
dc_fax().............A Fax Server based on Faxual II
dc_faxadd()..........Add an outgoing Fax to the Fax Server database
dc_faxbatch()........Process a batch of outgoing Faxes to the Fax Server database
dc_feof()............Is current opened binary/text file at end-of-file?
dc_ferror()..........Display the status of the last file operation
dc_fieldarray()......Capture the current work area to a field definition array
dc_fieldconfig().....Edit or add a field array element
dc_fielddfn()........Create a .PRG file with FIELD definitions from Dictionary
dc_fieldedit().......A Field Definition editor
dc_fieldimp()........Import Field Group(s) from the Import Field Dictionary
dc_fieldload().......Load a field group array from the field dictionary
dc_fieldpick().......Pick a field group from the field dictionary
dc_fields()..........Pick a field from a list of primary/relational fields
dc_fieldsave().......Save a field group array to the field dictionary
dc_fieldsort().......Establish whether Field Pick-lists should be sorted
dc_filearray().......Capture work area(s) to a file definition array
dc_fileedit()........A Database File / Work area Definition editor
dc_fileimp().........Import File Group(s) from the Import File Dictionary
dc_filelist()........Return an array of files chosen by operator
dc_fileload()........Load a file group array from the file (work area) dictionary
dc_filepick()........A Pick-List to choose a file
dc_filepik().........Pick a file (work-area) group from the file dictionary
dc_filesave()........Save Work area definition array to dictionary
dc_filevalid().......A function to validate file names entered into GETS
dc_filock()..........Lock the current data file
dc_find()............Find a record from a pick-list of available indexes
dc_fldtype().........Return the type of a field from it's name
dc_fmapdelete()......Delete a Field Map in the Field Map Dictionary
dc_fmapedit()........A Field Map editor
dc_fmapimport()......Import or Replace data fields based on a Field Map
dc_fmapload()........Load a Field Map array from the Field Map Dictionary
dc_fmappick()........Choose a Field Map name from Field Map Dictionary PickList
dc_fmapsave()........Save a Field Map array to the Field Map Dictionary
dc_fornext().........Evaluate list of expressions for specified range of numbers
dc_foxrdd()..........Get the best RDD to use for FoxPro compatability
dc_freadline().......Read a line of text from a file
dc_frmcolumns()......Edit report form columns from a report form array
dc_frmcreate().......Create a .FRM report file from a report form array
dc_frmlayout().......Edit a report form layout from a report form array
dc_frmmodify().......Edit or Create a Report form file
dc_frmout()..........Output a report form to screen, printer or file
dc_frmreport().......Front-End to Clipper's report function - displays Odometer
dc_frmstru().........Create a report form array from a .FRM form file
dc_gatemenu()........Pop-up a user-configurable menu to gateway to dos programs
dc_gateway().........Call the dos shell or any other executable program
dc_getactive().......Return the currently active GET object
dc_getclip().........Get the value of a Clipper Environment setting
dc_getdevout().......A Replacement for DevPos()/DevOut() when writing @SAY..GETS
dc_getdisplay()......Display a GET on the screen if it falls in scroll region
dc_getvalue()........Handy function for getting an input value from user
dc_gobottom()........Go to the bottom record of a "scoped" database
dc_gotoget().........Go directly to a desired GET
dc_gotop()...........Go to the top record of a "scoped" database
dc_handinit()........Initialize the file handle to name function
dc_handname()........Return a DOS file name from the file handle
dc_hasmemo().........Does the current database contain a memo field?
dc_help()............A General help and context-specific help system
dc_helpblock().......Post a code block to establish the Help system to call with F1
dc_helpcode()........Post a Help Code for the context-help F1 key
dc_helpf1()..........A context-specific help system
dc_helpfile()........Establish the file and alias name for the Help Database
dc_hunt()............Search all open index tags for a match to passed value
dc_ifelse()..........Evaluate a list of expressions based on a condition
dc_impeval().........Return a portion of a field based on passed parameters
dc_impextract()......Build DC_IMPEVAL() expression from a user-friendly menu
dc_impfields().......Create field mapping array from a pick-list of data fields
dc_impl()............Implode a window created by dc_expl()
dc_implode().........Implode a window created by dc_explode()
dc_impmapcreate()....Create a field replacement map (.DCF) file
dc_impmapload()......Load an array with a field replacement map
dc_impmapread()......Extract a field map array from the Static array
dc_impmapstore().....Store a field map array to the Static array
dc_import()..........Import a data file of any structure by matching fields
dc_impreplace()......Replace field data with data record of different type
dc_index()...........A pop-up expression builder for creating index keys
dc_indexcount()......Return the number of indexes open
dc_indexfilt().......Return the Conditional Index Expression
dc_indexkey()........Return the current index key expression
dc_indexlist().......Return an array of indexes that match open database
dc_indexname().......Return the full file name of the current index
dc_indexrestore()....Restore all index files from array created by dc_indexsave()
dc_indexsave().......Save the name(s) and order of all open indexes
dc_indexsel()........Select an index order or tag by key value
dc_iniload().........Load an array from a *.INI (initialization) file
dc_inisave().........Save an array to a *.INI (initialization) file
dc_init()............Initialize the dCLIP IDE Environment
dc_inkey()...........Moused replacement for INKEY()
dc_inkeyeval().......Post a code block for evaluation by DC_INKEY()
dc_inkeyrelease()....Require mouse to be released or positioned in specified area
dc_inkeywin()........Make DC_INKEY() behave like Windows
dc_insert()..........Insert a specified number of records
dc_interpret().......Interpret a command string
dc_isanum()..........Is a character Alphanumeric?
dc_isblank().........Are all the fields in the current record empty?
dc_isdbfmdx()........Is the current work area using a DBFMDX Driver?
dc_isdbfndx()........Is the current work area using a DBFNDX Driver?
dc_isdbfsix()........Is the current work area using a DBFSIX Driver?
dc_isdescend().......Is the current index key Descending?
dc_isfield().........Is a character string a field in the current work area?
dc_isflock().........Is the current data File locked?
dc_isntxcond().......Is the current work area a DBFNTX Conditional Index driver?
dc_ispath()..........Is a directory in a path string?
dc_ispdx()...........Is the current work area a PARADOX (PDX) driver?
dc_isprotmode()......Is the application running in Protected Mode?
dc_isrdd()...........Determine if a specified RDD is available
dc_isrlock().........Is the current Record locked?
dc_isshared()........Is the current workarea file opened in Shared mode?
dc_isstru()..........Verify the structure of the current database
dc_isunique()........Is the current index a Unique index?
dc_join()............Pop-up a user-prompt menu for joining databases
dc_keybuffer().......Save and Clear the Keyboard Buffer
dc_keyclear()........Clear Set-Keys previously loaded from Key Dictionary
dc_keycount()........Return the number of "active" records
dc_keydelete().......Delete a Key Group from the Key Dictionary
dc_keydisp().........Display the contents of Function Keys
dc_keyedit().........Edit a Key Group Definition in the Key Dictionary
dc_keyfile().........Establish the file and alias name for the Key Dictionary
dc_keyget()..........Load a Key Group array from the Key Dictionary
dc_keyhelp().........Display the status of Keys that are loaded
dc_keyincr().........Increment an Index key value to aid in setting a scope
dc_keyload().........Load Keys from a Key Group array or Key Dictionary
dc_keyname().........Display the name of a key from its INKEY value
dc_keyno()...........Return the ordinal position of the current record
dc_keyopen().........Open the Key Dictionary file
dc_keyorder()........Return the index order based on a Field Name
dc_keypick().........Pop-up a pick-list of all Key Groups in Key Dictionary
dc_keyrestore()......Restore SET KEYs from array created by DC_KEYSAVE()
dc_keysave().........Save all SET KEYS to an array and clear keys
dc_keystore()........Store a Key Group array to the Key Dictionary
dc_e()
Determine if DC_EDITDB() is running.
Syntax:
Arguments:
None.
Returns:
A logical .TRUE. if DC_EDIT() is running, .FALSE. otherwise.
Description:
DC_E() is a function that is used to determine if the user
is running a routine that was originally called from
DC_EDITDB(). This function will help prevent recursive
calls to DC_EDITDB() if they are not desired.
Source/Library:
_DCEDIT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editdb()
dc_edit() *
Full-screen record editor (obsolete)
Syntax:
Arguments:
NOTE : This function is listed for compatability with old
versions of dCLIP. It is recommended that you use DC_EDITDB()
instead.
The arguments are not listed. See your old documentation.
Description:
DC_EDIT() is a full-screen database editor. For a description
of the complete functionality see DC_EDITDB().
Notes:
DC_EDIT() is provided for compatability with previous versions
of dCLIP. It is recommended that you upgrade your applications
to use DC_EDITDB() instead.
Source/Library:
_DCEDIT.PRG/.OBJ, DCLIP.LIB
dc_edit2()
A function for calling edit-system sub-routines
Syntax:
Arguments:
(cMenu) is a single character designating the menu group.
cMenu Description
----- -------------------------------------
E Edit Options
V View Options
F File Options
S Search Options
(cCode) is a single or double character-set designating a
specific routine to execute. See below.
EDIT OPTIONS
------------
RF Roll-Back value into current field
RR Roll-Back value into current record
F Edit Currently selected Field
A Append a new record
R Replace record with VIRTUAL Record
U Update (Edit) VIRTUAL Record
B Blank Record (Empty all fields)
O Replace record with MAPPED Record (from import map)
D Delete Record using DEFAULT method
DD Delete/Recall Record (Toggle DELETED flag)
DM Set the Default Delete Method
BD Blow-Down
T Capture Current record to VIRTUAL record
S Set Append Mode
Y Set Data-Entry Mode
L Insert Blank Record(s)
N Insert Virtual Record(s)
I Import Text file to selected Memo Field
X Export selected Memo Field to Text File
C Create Field Replacement Macro
K Create Keyboard Macro
VIEW OPTIONS
------------
UDF Define a UDF (User-Defined Function Code-block)
BD Browse the Default configuration
BC Browse a configuration from the Catalog
BK Toggle Background paint mode
SB Toggle display of Scroll-Bar
HW Edit Help-Window Configuration
A Auto-update of relational windows
I Toggle inclusion of relational fields in edit
F Sort field list (or tag fields to edit)
V Size memo window
Z Toggle Zoom mode
BF Browse field configuration
D Edit currently selected field properties
E Add a new field to data-entry screen
J Insert a new field on data-entry screen
K Delete selected data-entry field
P Pick a color set
W Change editing window size
N Toggle Display of shadow on window
G Set Video display mode (25,34,50 rows)
U Edit using default configuration
T Tile-Edit
DD Set Drag Field/Descriptors Mode ON
DF Set Drag Field Mode ON
DB Set Drag Descriptors Mode ON
S Set spacing between rows
FILE OPTIONS
------------
C Close database
F Close indexes
O Open a new database
D Select a different work area to Edit
I Select a different index
T Select an index tag
A Delete an index tag
N Create an index tag
E Edit a Text file
M Edit a Label form file
R Edit a Report form file
P Load an Import map
U Save current record to Virtual Record File
V Restore Virtual Record from Virtual Record File
W Display work area status
S Save Edit to Dictionary, Array file or source
SX Export Edit to Dictionary, Array file or source
LA Load Edit configuration from an Array file
LI Load Edit configuration from Import dictionary
LF Load Edit configuration from a Function
X Delete an Edit configuration in dictionary
G Edit Field list (Field Dictionary)
SEARCH OPTIONS
--------------
S Set a filter
O Go to Top Record in File
B Go to Bottom Record in File
G Go to a specified record in File
H Hunt for a record
U Resume the Hunt
F Find a Record by Index
Q Quick-Locate a Record
L Locate a Record by Condition
C Continue the Locate
P Pan to a selected field
M Mark current record
R Return to Marked record
AS Toggle Auto-Seek mode
AT Toggle Record-Tag mode
AC Clear all record tags
AN Skip to next tagged record
AP Skip to previous tagged record
AK Set Key to use for record tagging
Returns:
NIL
Description:
DC_EDIT2() is a function that interfaces to most of the
subroutines called by menu selections from the data-entry
pull-down menu.
CAUTION: This function is designed to be called ONLY from
menu selections that are attached to the DC_EDITDB()
function otherwise errors could occur. Most of the routines
called by this function require that the DCEDIT array be
initialized and that a PRIVATE pointer named NEDITAREA be
set to the current work area. If you are going to use this
function or any of the _DCEDIT2_*() functions, then make
sure that they are called only by menus attached to the
DC_EDITDB() function or by procedures/functions called
from the DC_EDITDB() function either via the menu or
hot keys or a UDF.
NOTE: Alternative methods of calling edit-system routines
are documented here:
EDIT OPTIONS: _DCEdit2_e( cCode ) or DC_Edit2('E',cCode)
FILE OPTIONS: _DCEdit2_f( cCode ) or DC_Edit2('F',cCode)
SEARCH OPTIONS: _DCEdit2_s( cCode ) or DC_Edit2('S',cCode)
VIEW OPTIONS: _DCEdit2_v( cCode ) or DC_Edit2('V',cCode)
Source/Library:
_DCEDIT2.PRG/.OBJ, DCLIP.LIB
See Also:
_dcedit2_*()
dc_editappend()
Determine if the user is currently appending a new record
Syntax:
Arguments:
None.
Returns:
NIL
Description:
DC_EDITAPPEND() is a function that is called only from
sub-routines called while in DC_EDITDB(). This function is
used to determine if the user is currently in APPEND mode.
It may be used in routines that are called via a UDF code
block.
Source/Library:
_DCEDIT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editdb()
dc_editarest()
Restore a data-entry editing configuration array
Syntax:
Arguments:
(nArea) is the browse work area to restore. If this argument
is not passed then the current work area is default.
(aEdit) is the array with the contents of an editing array
saved by DC_EDITASAVE() or DC_EDITSAVE(). If (cEdit) is a
character string instead of an array, then the value of (cEdit)
must be equivalent to an EDIT TAG NAME for an edit configuration
stored in the DCEDIT.DBF edit-dictionary file. See DC_EDITSAVE()
for more information.
(lWorkRestore) if .TRUE. will also restore any work areas if a
WORK AREA Tag was saved in the Edit Array. A WORK AREA tag
is the name of a Work Group in the DCFILES.DBF database.
See DC_FILESAVE() for more information. The default is .FALSE.
meaning that databases matching the restored edit configuration
must already be open.
Returns:
A logical .TRUE. if the browse array(s) were restored
successfully, .FALSE. otherwise.
Description:
DC_EDITAREST() is used to restore an editing (data-entry)
array that was previously saved with DC_EDITASAVE() or
DC_EDITSAVE(). These functions are used to capture the
configuration of an editing work area (or multiple work areas)
and restore it at a later time.
Examples:
PROCEDURE main
LOCAL aEdit
use sales
dc_editdb()
aEdit := DC_EDITASAVE( SELE('SALES') )
close all
do something
use sales new
DC_EDITAREST( SELE(), aEdit )
dc_editdb()
Source/Library:
_DCEDIT5.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editasave()
dc_editdb()
dc_editasave()
Save the edit array object for a selected work area
Syntax:
Arguments:
(nArea) is the edit work area to save. If no parameter is
passed, then edit configurations for all open work areas
will be saved.
Returns:
A multi-dimensional array that is equivalent to the DC_EDITDB()
data-entry object for the specified work area.
Description:
DC_EDITASAVE() is used to save an editing array for later
restoring with DC_EDITAREST(). These functions are used to
capture the configuration of a data-entry work area and
restore it at a later time.
Examples:
PROCEDURE main
LOCAL aEdit
use sales
dc_editdb()
aEdit := DC_EDITASAVE( SELE('SALES') )
close all
do something
use sales new
DC_EDITAREST( SELE(), aEdit )
dc_editdb()
Source/Library:
_DCEDIT5.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editarest()
dc_editdb()
dc_editcnd()
Post an array of fields to edit
Syntax:
Arguments:
(aFields) is a single-dimensional array of field names.
Returns:
NIL
Description:
DC_EDITCND() is used to scope a group of fields on a pre-
designed data-entry screen so only a specified sub-group will
be displayed and edited.
Use DC_EDITCND() if you want to display only a selected sub-
group of fields. Use DC_EDITWHEN() if you want to display all
fields but allow editing only within a selected sub-group.
Examples:
use customer
DC_EDITCND({'NAME','STREET','CITY','STATE','ZIP'})
DC_EditDb()
Source/Library:
_DCEDIT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editwhen()
dc_editconfig()
Define the system 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 EDIT command.
[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 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_EDITCONFIG() is used to configure the system editor to be
called when using the EDIT command or DC_EDITPRG() function.
The system editor can be any DOS executable program and is
called via the gateway system.
Examples:
DC_EDITCONFIG( { 'Q2.BAT','300','C:\;D:\','L' } )
dc_editprg( 'test' )
Source/Library:
_DCEDPRG.PRG/.OBJ, DCLIP.LIB
See Also:
dc_turbedit()
dc_editprg()
EDIT PRG
EDITOR =
dc_editdb()
Invoke a multi-window full-screen edit of all work areas
Syntax:
Arguments:
(aOptions) is an array of parameters to define the size and
style of the editing window.
Element Type Description
------- ----- ---------------------------------------------
[ 1] U Reserved
[ 2] L .t. - Protect data from being changed by user
.f. - Allow data modification ( Default )
[ 3] N Start Display Row ( 0 is default )
[ 4] N Start Display Column ( 0 is default )
[ 5] N End Display Row ( 24 is default )
[ 6] N End Display Column ( 79 is default )
[ 7] L .t. - Display File Data at bottom of window
.f. - Don't Display File Data ( Default )
[ 8] L .t. - Don't display a shadow around the window
.f. - Display a shadow around window ( Default )
[ 9] L .t. - Display a record number column ( Default )
.f. - Don't display record numbers
[10] L .t. - Set the TAB for this window ( Default )
.f. - Don't set the TAB
[11] L .t. - Automatic update of Relational Windows
.f. - Don't update Relational Windows ( Default )
[12] U Reserved
[13] L .t. - Sticky-Edit mode ON
.f. - Sticky-Edit mode OFF ( Default )
[14] L .t. - Merge all relational (child) fields into
the edit window. (If item 11 is .FALSE.
then the Default is .TRUE., otherwise the
Default is .FALSE.)
.f. - Don't include child fields.
[15] L .t. - Display menu bar at the top of the physical
screen (Row 0, Column 0)
.f. - Display menu bar at the top of the browse
window (Default).
[16] N The edit screen page number to select. The
default is Page 1.
[17] N .t. - Display the contents of the selected field
on the second to last row of the edit
window (default).
.f. - Don't display field contents.
(aFields) is an array of field names to edit. If this argument
is not passed, then all fields will appear in the display.
(cUdf) is the name of a User-Defined Function to call after
each keystroke.
(lExit) if .TRUE. will paint the display and items on the screen
then return. .FALSE. is Default.
(lReSize) if .TRUE. will maintain the last configuration of the
Edit window for the selected work area except it will resize to
the new passed coordinates.
(lStartUp) is a RESERVED parameter.
(lRestScr) if .TRUE. (default) will restore the screen after
exiting, otherwise the information will remain on the screen.
(lApp) if .TRUE. will Enter APPEND and EDIT mode and append
a new record. .FALSE. (default) will establish mode as VIEW
mode.
(cAppMode) is a single character defining how new append
records are to be added before the user fills in the blanks.
"B" - Append a new record with blank fields (Default)
"V" - Append a new record with data from the VIRTUAL record
"I" - Append a new record with data from the IMPORT map
"C" - Append a new record with CARRY from current record
(cConfig) is the name of a Data-Entry configuration
to restore from the DCEDIT.DBF dictionary or a *.DBE file.
If (cConfig).DBE file is found, then the Edit configuration
will be restored from this file. If it is not found then
the Edit configuration will be restored from an EDIT
configuration with the Tag Name (cConfig) in the DCEDIT.DBF
dictionary. If this parameter is not passed, then an
Edit configuration of the same name as the database ALIAS
will be restored from the DCEDIT.DBF dictionary if it
exists, otherwise the fields will be placed in the data-
entry window in a default configuration.
(lProtect) if .TRUE. will protect the database from being
modified by the user. The default is .FALSE.
(aMenu) is an optional array which is used to replace the
default Edit pull-down menus. The menu array must conform
to the specification of the array returned by the
function DC_MENUEDIT() or DC_MENULOAD(). If (aMenu) is
a character string, then the string must contain the
NAME of the menu as contained in the menu dictionary file
(DCMENU.DBF).
(aKeys) is an optional array which is used to replace, add
or delete hot-keys from the Edit defaults. The key array
must conform to the specification of the array returned by
the function DC_KEYEDIT() or DC_KEYLOAD(). If (aKeys) is
a character string, then the string must contain the
NAME of the key-set as contained in the key dictionary file
(DCKEY.DBF).
(aMouse) is an optional array which is used to add to the
default mouse-actions. The mouse array must conform
to the specification of the array defined for use by the
function DC_MOUSEKEYS() or returned by the function
DC_MOUSEEDIT() or DC_MOUSELOAD(). If (aMouse) is a
character string, then the string must contain the
NAME of the mouse-set as contained in the mouse dictionary
file (DCMOUSE.DBF).
(lBkGrnd) if .TRUE. (default) will paint a default
background and all edit screens for all work areas. If
.FALSE., then only the edit screen for the current work
area will be displayed over the existing screen.
(lEditExit) if .TRUE. will force EDITING mode (same as pressing
ENTER) then exit the function when the user presses F10 to
save or ESCAPE to abort. No other functionality but data-
entry will be allowed in this mode. Default is .FALSE.
Returns:
NIL
Description:
DC_EDITDB() is a Multi-Window database editing system that can
be used as a complete menu-driven DBMS. DC_EDITDB() is the
base system for all dCLIP full-screen editing features. This
is an array-driven system; ie, a multi-dimensional array
( DCEDIT ) object is used to store all the parameters for all
work areas.
DC_EDITDB() supports a complete set of menus and options: Edit,
View, File, Search, Print, Utilities, etc. The dCLIP editing
system supports the following features:
1. Cut and Paste
2. Keyboard Macros
3. User-configuration
4. Multi-window Editing
5. Relational Editing (merge relational fields in one-window
or display multiple windows).
6. Sticky Editing (remembers field configuration, pointers,
screen, etc).
7. Define field-layouts, validations, descriptors, etc.
8. Save configuration to array-file, data-dictionary or
source-code.
See the section titled DATA EDITING SYSTEM for a complete
description of how to use the DC_EDITDB() function.
Notes:
See DC_BROWVALUE() for the dCBROWSE array API.
Examples:
use customer
DC_EDITDB()
use invoice new
DC_EDITDB( { , , 0, 0, 24, 39 } )
use invitems new
set relation to inv_nmbr into invoice
DC_EDITDB( { , , 0, 40, 24, 79, , , .t., .f., , .t., .t. } )
Source/Library:
_DCEDIT.PRG/.OBJ, DCLIP.LIB
See Also:
OVERVIEW
EDIT
dc_editdel()
Delete an Edit configuration in the Edit Dictionary
Syntax:
Arguments:
(cConfig) is the Tag Name of the Edit Configuration to
delete. If no argument is passed then a pick-list of all
Edit configurations will be displayed.
Description:
DC_EDITDEL() is used to delete an Edit Configuration from
the DCEDIT.DBF Edit (Data-Entry) Dictionary file.
Examples:
DC_EDITDEL("myedit")
Source/Library:
_DCEDIT4.PRG/.OBJ,DCLIP.LIB
See Also:
EDIT DELETE
dc_editfile()
Pop-up a user-prompt menu to edit an ASCII file
Syntax:
Arguments:
(cFileName) is the name of the ascii file to edit. If no
argument is given, then the user will be prompted for the name
of the file.
Description:
DC_EDITFILE() is used to edit any ascii file using the dCLIP
internal editor. See DC_MEMO() for details on how to use the
dCLIP editor.
Examples:
@ 11,10 prompt "Edit a Database"
@ 12,10 prompt "Edit an Ascii File"
menu to nChoice
do case
case nChoice = 1
dc_dbfsel()
dc_browsedb()
case nChoice = 2
DC_EDITFILE()
endcase
Source/Library:
_DCMEMO.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editprg()
dc_editflag()
Set or Get specific information about an edit object
Syntax:
Arguments:
(cCode) is a word describing the value to GET or SET.
cCode GET SET Type Description
---------- --- --- ---- ----------------------------------
ZOOM X L .t. if ZOOM mode ON, .f. if OFF
PAINTITEMS X Repaint the current data entry items
PAINTSCRN X Repaint the current data entry screen
(nArea) is the editing work area. If this parameter is not
passed then the currently selected area is the default.
(lGetValue) if .TRUE. will GET the value of the configuration
parameter. If .FALSE. (default), then it is assumed to be
a SET option.
(xDefault) is a default value to return in the event that
the editing screen has not been initialized. Use this to
prevent errors in your code.
Returns:
The GET value.
Description:
DC_EDITFLAG() is used to set or get specific information about
a data-entry configuration in order to control the edit or
the screen from functions called by SET KEYS, menus or UDF's
when in the DC_EDITDB() function.
NOTE: This is an evolving function and has been provided to
meet specific needs for specific applications. The list of
options is constantly changing so it is recommended that
you look at the _DCEDIT.PRG source code for the latest
information.
Examples:
/* In this example DC_EDITFLAG() is used to determine
whether the user has ZOOMED the display. The code is
being called in a UDF that is evaluated from the
DC_EDITDB() function. The UDF is used to display a
status box in the area of the screen below the edit
screen. The status box must display ONLY if the edit
screen has not been ZOOMED to use the full-screen. */
IF !DC_EDITFLAG('ZOOM')
StatusDisplay()
ENDIF
Source/Library:
_DCEDIT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editdb()
dc_editload()
Load an editing array from edit dictionary or array file
Syntax:
Arguments:
(cEditName) is the name of the editing configuration to
load (up to 8 characters). If no parameter is passed, then
a pick-list of all Edit configurations in the DCEDIT.DBF
dictionary will be displayed.
(cMode) is a single character designating the source:
A - From an Array File. If this option is chosen then
the user will be prompted with a dialogue screen to
enter the name of the array file. The default file
name will be filled in as (cEditName).DBE.
F - From a Function. If this option is chosen then the
function (cEditName)_E() will be called to get the
array, if it exists.
D - From the DCEDIT.DBF dictionary. An Edit Configuration
with the Tag Name (cEditName) will be loaded into the
array, if it exists.
NONE - If no parameter is passed, then the array will be
loaded first from the function (cEditName)_E(), if it
exists, and secondly from the file (cEditName).DBE if it
exists, and thirdly from the DCEDIT.DBF dictionary.
(lCache) if .TRUE. (default) will save the configuration
to a static cache so the next time it is requested it will
be reloaded from the cache for faster speed. If .FALSE. or
if the DC_MEMCACHE() setting is 0, then it will not be saved
to the static array.
(lMessage) if .TRUE. (default) will warn the operator if
the edit configuration does not exist in the edit dictionary.
(lCreateDbf) if .TRUE. (default) will create the DCEDIT.DBF
dictionary if it does not exist. If .FALSE. and the
DCEDIT.DBF dictionary does not exist, then the function will
return a NIL.
(lImport) if .TRUE. will attempt to load the configuration
from a dictionary file named DXEDIT.DBF rather than the
standard dictionary named DCEDIT.DBF.
Returns:
An editing array that conforms to the specification documented
in ARGUMENTS of the function named DC_EDITSAVE().
Description:
DC_EDITLOAD() is used to load a data-entry configuration
from the DCEDIT.DBF dictionary file, a *.DBE array file
or a function call.
Notes:
If a function has been linked into the executable program
with the name (cEditName)_E(), then it will be called to
get the edit configuration array rather than loading from
the DCEDIT.DBF dictionary. This is a much faster method
of loading a configuration. The function can be created
by saving an Edit configuration to source-code with a
menu selection from the data-entry design screen.
Examples:
use customer
aEdit := DC_EDITLOAD( 'CUSTOMER' )
DC_EditRestore( aEdit )
Source/Library:
_DCEDIT4.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editsave()
dc_editdb()
EDIT
dc_editlocal()
Allows GET/SET access to the Local array in DC_EDITDB()
Syntax:
Arguments:
NONE.
Returns:
NIL.
Description:
DC_EDITLOCAL() is used to access an array of information
about the currently running DC_EDITDB() function. This
function is used to look at current edit configuration
conditions or to modify same.
The DC_EDITDB() function uses a PUBLIC array named DCEDIT
and a local array named aEditLocal. The local array is
released upon exiting the DC_EDITDB() function whereas the
public array is maintained throughout the application.
Sometimes it is necessary to get access to the local values
in this array.
Each array element is defined in the DCEDIT.CH file.
Notes:
This function should be used only in procedures called
from within DC_EDITDB() such as an attached menu, a SET KEY
or a UDF, otherwise an error could result.
Examples:
/* Determine whether or not the user is in APPEND mode */
LOCAL aEditLocal := DC_EditLocal()
IF Valtype(aEditLocal) = 'A' .AND. aEditLocal[87]
DC_MsgBox('Yes, the user is Appending Records')
ELSE
DC_MsgBox('No, the user is Not Appending Records')
ENDIF
Source/Library:
_DCEDIT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editdb()
dc_editmenu()
Restore an Edit Menu from an Array or Data-Dictionary
Syntax:
Arguments:
(aMenu) is a menu array created by DC_MENUEDIT() or
restored from the Menu-Dictionary database via DC_MENULOAD().
If (aMenu) is not passed then (nMode) is used to determine
how to load the menu:
0 - Reserved
1 - Restore default menu
2 - Load a menu from the Data-Dictionary (choose from
pick-list)
3 - Edit and load menu in the Data-Dictionary (choose from
pick-list)
Returns:
A "compiled" menu array that can be passed to DC_MENUMAIN().
Description:
DC_EDITMENU() is used to restore a database editing menu
from the Menu-Dictionary or an array.
The Editing system, DC_EDITDB(), includes a default menu
that includes nearly every option to make the Editing
system into a complete Data-Base Manager. Often times,
the developer wants to provide the dCLIP editing system in
an application but limit the menu options available to the
user. This can be accomplished by designing a custom
browse menu using DC_MENUEDIT() or MENU EDIT and then
replacing the default menu via DC_EDITMENU(). The dCLIP
Menu-Dictionary database, DCMENU.DBF, contains a template
of the default editing menu named "DCEDIT". It is
recommended that you load this menu into the menu editor
and give a custom name such as "MYEDIT", make the
desired deletions, additions, or modifications, then save
it to the data-dictionary or to a source-code file for
restoring with DC_EDITMENU().
Examples:
(-- Saving an Editing and Menu Configuration --)
/* -- Open databases -- */
OpenData()
/* -- design editing windows to fit requirements -- */
dc_edittile()
/* -- save editing configuration to source-code -- */
dc_editsource() // Save to MYEDIT()
/* -- design editing menu to fit requirements -- */
dc_menuedit() // Save to MYEDITMENU()
RETURN
(-- Compile and Run the new Editing System --)
/* -- compile and link new source-code -- */
/* -- Run editing configuration in new .EXE -- */
OpenData()
DC_EDITMENU( MyEditMenu() )
DC_EditRestore( MyEdit() )
RETURN
FUNCTION OpenData()
use customer
use invoice new index invoice
use invitems new index invitems
select customer
set relation to cust_nmbr into invoice
select invoice
set relation to inv_nmbr into invitems
select customer
RETURN nil
Source/Library:
_DCEDIT3.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editrestore()
dc_menumain()
dc_editdb()
EDIT
dc_editmode()
Set the default mode for tile-editing
Syntax:
Arguments:
(nMode) is an optional argument for defining the method to
display the edit windows being opened for the multiple
database editing.
nMode
0 Best fit (default)
1 Four windows ( screen split in half vertically and
horizonally )
2 Four windows ( screen split horizontally )
3 Three windows ( screen split horizontally )
4 Two windows ( screen split vertically )
5 Two windows ( screen split horizontally )
6 Six windows ( three across / two down )
Returns:
The current browse-tile mode setting.
Description:
DC_EDITMODE() sets the default mode for "tile-editing" when
calling DC_EDITTILE() or EDIT TILE with no "window-style"
parameter.
Examples:
. use all like DC*
. DC_EDITMODE(4)
. dc_edittile()
Source/Library:
_DCEDIT2.PRG/.OBJ, DCLIP.LIB
See Also:
dc_edittile()
dc_editdb()
EDIT TILE
SET
dc_editpick()
Pick an editing configuration from the edit dictionary
Syntax:
Arguments:
(cTitle) is the title to display on the pick-list box.
Returns:
A character string.
Description:
DC_EDITPICK() is used to pick the name of a data-entry
editing configuration from the DCEDIT.DBF edit dictionary.
Examples:
cEditName := DC_EDITPICK()
IF !Empty(cEditName)
aEdit := DC_EditLoad( cEditName )
ENDIF
Source/Library:
_DCEDIT4.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editload()
dc_editdb()
EDIT
dc_editprg()
Edit a .PRG source-code file
Syntax:
Arguments:
(cFileName) is the name of the ascii file to edit. If no
argument is given, then the user will be prompted for the name
of the file. If no extension is included, then .PRG is
assumed.
(nLineNmbr) is the line number to go to. If no parameter is
passed then the editing will start at line 1.
(cParameters) is an optional set of parameters to pass to the
editor.
(lWriteScreen) if .TRUE. will write the contents of the
current screen to a file named DCLIP.SCR. The editor can then
be used to bring up this screen in a separate window as a
reference. .FALSE. is default.
Description:
DC_EDITPRG() is used to edit a source code file. This function
will use the editor defined as the "system" editor via the
EDITOR= command in DCLIP.SYS or the DC_EDITCONFIG() function.
Notes:
If the drive and directory is not included in the (cFileName)
argument, then DC_EDITPRG() will search for the file first in
the SET DCLIP directory followed by the SET PDIR directory (if
file is a .PRG).
Examples:
dc_editconfig( { 'Q2.BAT','300','C:\;D:\','L' } )
DC_EDITPRG( 'test' )
Source/Library:
_DCEDPRG.PRG/.OBJ, DCLIP.LIB
See Also:
EDIT PRG
dc_turbedit()
/
dc_editrec()
Pop-up a record editing window
Syntax:
Arguments:
(lAppend) if .TRUE. will append a new record. If .FALSE.
(default) then the currently selected record will be edited.
(nStRow), (nStCol), (nEnRow), (nEnCol) are the screen
coordinates for the edit window. If no parameters are passed
then the default coordinates will be 2,10,21,70.
Returns:
A logical .TRUE. if the record was modified, .FALSE. otherwise.
Description:
DC_EDITREC() is a record editor which is used to modify the
data in the currently selected database record or to append
a new record.
Notes:
Clicking the mouse on any of the window perimeters will
size the window. Clicking the mouse on the field name
area will move the window.
Examples:
use customer
DC_EDITREC() // Edit current record
DC_EDITREC(.t.) // Append and edit a new record
Source/Library:
_DCEDITR.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editdb()
EDIT
dc_editrestore()
Restore and execute an Editing configuration from an array
Syntax:
Arguments:
(aEdit) is a browse-definition array that conforms to the
specifications documented in ARGUMENTS of DC_BROWSAVE().
or
(cEdit) is the "tag name" of an edit configuration that was
previously saved in the DCEDIT.DBF dictionary.
(lWorkRestore) if .TRUE. (default) will also restore any
work areas if a FILES tag is included in the (aEdit)
array. If .FALSE. then it is assumed that the files
associated with this edit configuration are already open.
(lBackground) if .TRUE. (default) will display a background
screen that will fill the entire screen area. This is the
same background displayed when using the EDIT command.
If .FALSE. then the edit screen will be displayed over
any existing screen.
(lSaveKeys) if .TRUE. will save all SET KEYS, then clear
them and restore them after returning from the Edit.
Returns:
NIL
Description:
DC_EDITRESTORE() is used to restore an editing configuration
that was previously saved with DC_EDITSOURCE(). These
functions are used to capture the configuration of a single
editing work area or all editing work areas.
Examples:
(-- Design and Save the Editing Configuration --)
/* -- Open databases -- */
OpenData()
/* -- design editing windows to fit requirements -- */
dc_edittile()
/* -- save editing configuration to source-code -- */
dc_editsource() // Save to MYEDIT()
RETURN
(-- Compile and Run the new Editing Configuration --)
/* -- compile and link new source-code -- */
/* -- Run Editing configuration in new .EXE -- */
OpenData()
DC_EDITRESTORE( MyEdit() )
RETURN
FUNCTION OpenData()
use customer
use invoice new index invoice
use invitems new index invitems
select customer
set relation to cust_nmbr into invoice
select invoice
set relation to inv_nmbr into invitems
select customer
RETURN nil
Source/Library:
_DCEDIT3.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editsource()
dc_editsave()
dc_editdb()
EDIT
dc_editrev()
Enable automatic updated of revision fields
Syntax:
Arguments:
(lEditRev) if .TRUE. will automatically update the "revised"
fields if they exist. .FALSE. is the default.
Returns:
NIL
Description:
DC_EDITREV() is used to enable the automatic updating of six (6)
fields in each database record whenever a record is added or
edited. To enable this feature, you must call DC_EDITREV(.t.)
and you must have the following six fields in each of your client
databases:
Field Name Type Legnth Description
---------- ---- ------ -------------------------------
ENTRYDATE D 8 Date record was first created
ENTRYTIME C 8 Time record was first created
ENTRYUSER C 8 User ID of user who created record
REVDATE D 8 Date record was last edited
REVTIME C 8 Time record was last edited
REVUSER C 8 User ID of user who edited record
If any of the above fields do not exist, NO error will occur, they
just won't be updated. These fields are updated only when databases
are modified by the DC_EDITDB() function or the EDIT command.
Examples:
// Set Edit Revision Fields mode ON
DC_EDITREV(.t.)
Source/Library:
_DCEDIT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editdb()
OVERVIEW
EDIT
dc_editsave()
Save a data-entry array to dictionary, array file or source code
Syntax:
Arguments:
(aEdit) is an array of 2 sub-arrays:
Sub-Array #1 is an array of options:
Element Type Description
------- ---- -----------------------------------
1 C Edit Tag Name (up to 10 chars)
2 C Edit Files Tag Name (up to 8 chars)
used for opening files when restoring
edit configuration.
3 C Edit Menu Tag Name (up to 8 chars)
used for restoring a specified menu.
4 C Edit Keys Tag Name (up to 8 chars)
used for restoring a set of keys.
5 C Description
The elements in Sub-array #1 will be edited by the user
before saving the edit configuration. If no array is
passed, then the user will be given blanks to fill out.
If no FILES, MENU or KEYS tags are entered by the user, the
EDIT configuration will be restored with default
conditions.
Sub-array #2 consists of a sub-array containing the edit
configuration for each work area.
Each edit configuration array consists of 2 sub-arrays:
Sub-sub-array #1 is an array of general options for the
edit configuration. See DCEDIT.CH for the definitions of
this array.
Sub-sub-array #2 is an array consisting of one field-array for
each edit field. See DCFIELDS.CH for the definition of the
Fields sub-array.
(cSaveMode) is a character string of up to 3 characters to
establish the default save mode. Include 1 character for
each mode to save.
D - Save to DCEDIT.DBF dictionary
A - Save to a *.DBE array file
S - Save to source code
(lGets) if .TRUE. (default) will allow the operator to
edit the save parameters or abort the operation. If .FALSE.,
then the edit configuration will be saved.
(lMessage) if .TRUE. (default) will display a message if the
edit configuration already exists in the dictionary and allow
the operator to abort the save. If .FALSE. the edit will be
overwritten if it already exists.
(nArea) is the work area of the edit configuration to save.
If this parameter is not passed, then the currently selected
work area is the default.
Returns:
A logical .TRUE. if the configuration was successfully saved,
.FALSE. otherwise.
Description:
DC_EDITSAVE() is used to save a data-entry (editing)
configuration to the DCEDIT.DBF dictionary file, a *.DBE
array file or source-code or any combination.
Editing configurations, when saved, may also included a
TAG reference to a set of FILES for restoring work areas,
a MENU and/or a set of KEYS. This allows for completely
restoring a data-entry configuration at a later time from
the edit dictionary, an array file or by running a function
saved as source code.
Examples:
use customer
dc_editdb() // create dCEDIT array configuration
aEdit := {{},dCEDIT }
DC_EDITSAVE( aEdit )
Source/Library:
_DCEDIT4.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editload()
dc_editdb()
EDIT
dc_editsource()
Write Multiple-Window Editing configuration to source code
Syntax:
Arguments:
None.
Returns:
Nil
Description:
DC_EDITSOURCE() is used to write the contents of the edit
arrays to source code for compiling and linking into an
application. The generated source code will create a
function that can be called in an application. This function
will return an array containing all information about the
browse-windows including window sizes, fields, options,
descriptors, and relational update information. The array
can then be passed to DC_EDITRESTORE() to run the database
editor.
DC_EDITSOURCE() makes designing of tiled editing systems
very simple and also provides the option of saving the editing
configuration to an ARRAY file rather than source code. This
eliminates the need to compile the editing configuration but
instead allows the user to restore the configuration on-the-fly
from a file.
When used in conjuction with DC_EDITMENU(), an editing
configuration can be restored that will also include custom
menu selections or even a complete replacement to the default
menu.
Examples:
(-- Design and Save the Editing Configuration --)
/* -- Open databases -- */
OpenData()
/* -- design editing windows to fit requirements -- */
dc_edittile()
/* -- save editing configuration to source-code -- */
DC_EDITSOURCE() // Save to MYEDIT()
RETURN
(-- Compile and Run the new Editing Configuration --)
/* -- compile and link new source-code -- */
/* -- Run editing configuration in new .EXE -- */
OpenData()
DC_EditRestore( MyEdit() )
RETURN
FUNCTION OpenData()
use customer
use invoice new index invoice
use invitems new index invitems
select customer
set relation to cust_nmbr into invoice
select invoice
set relation to inv_nmbr into invitems
select customer
RETURN nil
Source/Library:
_DCEDIT3.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editrestore()
EDIT
dc_editdb()
dc_editstru()
Edit the dCLIP structure-extended database
Syntax:
Arguments:
(cFileName) is the name of the "STRUCTURE EXTENDED" database.
This database must have at least the four (4) following fields:
Field Name Type Length
----------- ------------ -------
FIELD_NAME C 10
FIELD_TYPE C 1
FIELD_LEN N 3
FIELD_DEC N 3
Returns:
A logical .TRUE. if the structure file was modified by the user,
.FALSE. otherwise.
Description:
DC_EDITSTRU() is used to edit a STRUCTURE EXTENDED type
database file. This type of database contains the definition
of the fields for creating or modifying .DBF files.
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
dc_edittile()
Invoke set of edit windows for specified list of work areas
Syntax:
Arguments:
(nMode) is an optional argument for defining the method to
display the editing windows being opened for relational or
multi-window editing.
nMode
1 Four windows ( screen split in half vertically and
horizonally )
2 Four windows ( screen split horizontally )
3 Three windows ( screen split horizontally )
4 Two windows ( screen split vertically )
5 Two windows ( screen split horizontally )
6 Six windows ( three across / two down )
If no (nMode) argument is given, then a set of windows will
automatically be created in a "best-fit" screen configuration.
(aAlias) is an array of database ALIASes to edit. If no array
argument is passed, then all open work areas will be included
in the tiled edit configuration.
(lEdit) if .TRUE. (default) will initiate the edit (apply focus
to first edit window) after painting all the edit windows on
the screen. If .FALSE., then the edit windows will be created
and painted only.
(lRelation) if .TRUE. will set a flag to automatically update
all other edit windows that have relations set. When the
parent record pointer is moved, the child edit windows will
be repainted. If .FALSE. then all child fields will be merged
into the parent edit window and the child edit windows will
be updated only when selected.
Description:
DC_EDITTILE() is a front-end to DC_EDITDB() that creates
multiple editing windows.
"Tile-Editing" is a term describing the placement of multiple
editing windows in the display in a "pattern" to work with
several databases at the same time. Use tile-editing to
establish one-to-many relations, to facilitate cut-and-paste
operations between several databases, or to simply make it
easier to monitor data in several work areas at the same time.
Examples:
. use all like DC*
. DC_EDITTILE()
. close all
. use all
. DC_EDITTILE( 3, { 'CUSTOMER','INVOICE','SALES' } )
Source/Library:
_DCEDIT2.PRG/.OBJ, DCLIP.LIB
See Also:
EDIT TILE
dc_editdb()
EDIT
dc_editwhen()
Post an array of fields to edit
Syntax:
Arguments:
(aFields) is a single-dimensional array of field names.
Returns:
NIL
Description:
DC_EDITWHEN() is used to scope a group of fields on a pre-
designed data-entry screen so only a specified sub-group will
be edited.
Use DC_EDITCND() if you want to display only a selected sub-
group of fields. Use DC_EDITWHEN() if you want to display all
fields but allow editing only within a selected sub-group.
Examples:
use customer
DC_EDITWHEN({'NAME','STREET','CITY','STATE','ZIP'})
DC_EditDb()
Source/Library:
_DCEDIT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_editcnd()
dc_encrypt()
Encrypt a character string or number
Syntax:
Arguments:
(xValue) is a character string or numeric value.
(cKey) is a character sequence, of any length, to use as
a "seed" for the encryption. If this parameter is not
passed, then a default seed will be used.
Returns:
An encrypted value of the same type as the original value.
Description:
DC_ENCRYPT() is used to encrypt a character string, a memo
or a numeric value for later decryption with DC_DECRYPT().
This function uses a "key" or "seed" string and an
EXCLUSIVE-OR algorithm for performing the encryption.
Examples:
-- Example 1 --
a := DC_ENCRYPT( "This is a test","CLIPPER" )
? a
—¤ £ð¬¡ã餵¶¦
? DC_Decrypt( a, "CLIPPER" )
This is a test
-- Example 2 --
a := DC_ENCRYPT( 23456.289, "CLIP53" )
? a
59236.515
? DC_Decrypt( a, "CLIP53" )
23456.289
Source/Library:
_DCENCRY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_decrypt()
dc_envirrest()
Restore the Clipper environment from an array or file
Syntax:
Arguments:
(aEnvir) is an array of environment variables that was saved by
DC_ENVIRSAVE().
(cEnvirSave) is an array file containing the contents of the
environment that was saved by DC_ENVIRSAVE( (cEnvirSave) ).
Returns:
NIL
Description:
DC_ENVIRREST() is used to restore all 38 Clipper environment
variables from an array or a file created by DC_ENVIRSAVE().
The Clipper environment consists of everything from SET CURSOR,
SET DEFAULT, to SET ALTERNATE, etc.
Use this function to restore the Clipper environment after
running a task that may have altered the environment.
Examples:
-- EXAMPLE 1 --
aEnvir := dc_envirsave()
do something
DC_ENVIRREST( aEnvir )
-- EXAMPLE 2 --
dc_envirsave( 'ENVIR.AR' )
do something
DC_ENVIRREST( 'ENVIR.AR' )
Source/Library:
_DCENVIR.PRG/.OBJ, DCLIP.LIB
See Also:
dc_envirsave()
dc_envirsave()
Save the entire Clipper environment to an array or file
Syntax:
Arguments:
(cFileName) the name of the file to save the Clipper
environment to.
If no argument is passed then no file will be created, however
the current Clipper environment will still be returned in an
array.
Returns:
The 38 Clipper environment variables in an array. See ARRAY.CH
(included in Clipper distribution) for the values.
Description:
DC_ENVIRSAVE() is used to save all 38 Clipper environment
variables to an array or a file for later restoring by
DC_ENVIRREST().
The Clipper environment consists of everything from SET CURSOR,
SET DEFAULT, to SET ALTERNATE, etc.
Examples:
-- Example 1 --
aEnvir := DC_ENVIRSAVE()
do something
dc_envirrest( aEnvir )
-- Example 2 --
DC_ENVIRSAVE( 'ENVIR.AR' )
do something
dc_envirrest( 'ENVIR.AR' )
Source/Library:
_DCENVIR.PRG/.OBJ, DCLIP.LIB
See Also:
dc_envirrest()
dc_erase()
Pop-up a user-prompt menu for erasing a file
Syntax:
Arguments:
NONE
Returns:
A logical .TRUE. if a file was erased, .FALSE. otherwise.
Description:
DC_ERASE() is a high-level function that prompts a user with
menus and pick-lists for erasing any file.
Examples:
@ 12,10 prompt "Copy a File"
@ 13,10 prompt "Erase a File"
menu to nChoice
do case
case nChoice = 1
dc_copyfile()
case nChoice = 2
DC_ERASE()
endcase
Source/Library:
_DCERASE.PRG/.OBJ, DCLIP.LIB
See Also:
UTIL
dc_util()
dc_error()
The dCLIP error handler
Syntax:
Arguments:
(cFileName) is the name of the default error log file in the
event that the operator chooses to write out error information
to a file. If no parameter is passed, then DCLIP.LOG is the
default.
Description:
DC_ERROR() is the dCLIP error handler. This function is used
by "installing" it in an error block via the Clipper
Errorblock() function.
Examples:
FUNCTION startup()
Errorblock( { |e| DC_ERROR( e ) } ) // Install dCLIP error
// handler
do main
return nil
Source/Library:
_DCERROR.PRG/.OBJ, DCLIP.LIB
See Also:
dc_errormsg()
dc_errormsg()
Display an array of error messages in a window
Syntax:
Arguments:
(aMessage) is an array of messages to display in the popup
box.
[lSound] - if .FALSE. don't sound error beep; default is
.TRUE.
[cTitle] is the title displayed in top line center of popup
box; defaults to 'ERROR'
Returns:
nil
Description:
DC_ERRORMSG() is used to display a popup error box onscreen.
You can override the defaults for sound and title as optional
params. The box is self centering onscreen; the text array
is centered inside the box. Pressing any key or mouse
button will remove the popup box.
Notes:
dc_errormsg ( (aMessage), [lSound], [cTitle] ) -) Nil
Examples:
if !isprinter()
DC_ERRORMSG( {'Printer Is Offline - Please Ensure Power',;
'Is On And Paper Is Inserted Properly'},;
'',;
' Printer Error ')
else
...
...
endif
Source/Library:
_DCMSG.PRG/.OBJ, DCLIP.LIB
See Also:
dc_msgbox()
dc_alert()
dc_execute()
Execute a function based on passed parameters
Syntax:
Arguments:
(cCommand) is the command line to interpret and execute.
The command line arguments are defined as follows:
/W [(WorkGroup)] - Restore files, indexes, relations, etc. from a
*.DCW Work file (if it exists) or from a File
Group Tag named (WorkGroup) in the DCFILES.DBF
file dictionary. If no (WorkGroup) name is
is given then a pick-list of File Groups
will be displayed.
/M [(Menu)] - Run a menu from the DCMENU.DBF Menu Dictionary.
If no (Menu) name is given then a pick-list of
Menus will be displayed.
/B [(Browse)] - If a (Browse) name is given, then load the
Browse configuration from the DCBROWSE.DBF
Browse dictionary and run the Browse System.
If no (Browse) name is given, then run the
browse using the built-in default browse
configuration.
/E [(Edit)] - If an (Edit) name is given, then load the
Editing configuration from the DCEDIT.DBF
Edit dictionary and run the Data-Entry System.
If no (Edit) name is given, then run the
edit using the built-in default edit
configuration.
/D [(Database)] - If a (Database) name is given, then open
the database, otherwise display a pick-list
of available databases.
/R [(Rdd)] - If an (Rdd) name is given, then select the
(Rdd) as the default data driver, otherwise
display a pick-list of available RDD's.
/I [(Index1),... - If a list of (Index)es is given, then open
(IndexN)] the index list (after opening the (database)
otherwise, display a list of indexes that
match the database.
/H - Display command line help
/Q - Quit to calling program, otherwise Return to
the dot-prompt.
/T - Start-Up dCLIP using the Turbo-Assistant,
otherwise start-up at the dot-prompt.
/A (Batch) - Execute (Interpret) a *.DCB (Batch) file
(p1,..p5) with parameters
/C (command) - Interpret a Dot-Prompt Command
/S (file) - Use (file) as alternative to DCLIP.SYS parameter file
/O (object) - Dynamic-Link a Clipper-Compiled *.OBJ file
/F (function) - Run a function (with parameters)
The following single arguments are also recognized for compatability
with drag and drop features of Windows and OS/2:
(database).DBF - Open database and Browse it
(workfile).DCW - Restore work areas from Work File and Browse
(object).OBJ - Load Clipper-compiled .OBJect and run
(batch).DCB - Execute a dCLIP Batch file
Returns:
A logical .TRUE. if the /Q parameter was included in the
(cCommand) string, otherwise a .FALSE.
Description:
DC_EXECUTE() is used to execute a function or set of functions
based on the parameters in the command passed. This function
is called by the dCLIP start-up program to automatically
load and run menus, open file groups and restore browse and
data-entry screens.
Examples:
* Restore Work Areas from CUSTOMER.DCW
* Browse databases
* Quit
DC_EXECUTE( '/W CUSTOMER /B /Q' )
Source/Library:
_DCEXE.PRG/.OBJ, DCLIP.LIB
See Also:
dc_do()
dc_expl()
Explode a window with pre-defined colors
Syntax:
Arguments:
(nStartRow), (nStartCol), (nEndRow), (nEndCol) are the screen
coordinates for the box to explode.
(cTitle) is the title heading on the top of the box. If no
argument is given, then there will be no title area.
(lNoShadow) if .TRUE. will prevent the shadow from being
created. Default is .FALSE. (shadow enabled).
(lPaintOnly) if .TRUE. will paint the box on the screen but not
perform the "exploding" process. Default is .FALSE. (explode).
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_EXPL() will explode a box on the screen. This function is a
front-end to DC_EXPLODE() that uses pre-defined system colors
that are part of the DCCOLOR color array. See DCCOLOR.CH for a
definition of the color manifest constants.
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:
cSaveScreen := DC_EXPL( 10,10,12,70, ' Enter a command ' )
cCommand := SPACE(50)
@ 11,12 get cCommand
read
dc_impl( cSaveScreen )
Source/Library:
_DCEXPL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_impl()
dc_explode()
dc_implode()
dc_explmode()
Enable/Disable exploding windows
Syntax:
Arguments:
(lExplode) if .TRUE. will force all windows created with
DC_EXPL() and DC_EXPLODE() to "explode" (default). If .FALSE.
then all windows will be painted in "instant on" mode.
Returns:
A logical value. .T. - Instant On Mode, .F. - Explode Mode.
Description:
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. DC_EXPLMODE() affects the operation of the
following functions:
DC_EXPL(), DC_EXPLODE(), DC_IMPL(), DC_IMPLODE()
Examples:
DC_EXPLMODE( .t. ) // Set instant on mode
dc_browtile() // Paint all the browse windows
DC_EXPLMODE( .f. ) // Set explode mode
Source/Library:
_DCEXPL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_expl()
dc_explode()
dc_explode()
Explode a window
Syntax:
Arguments:
(nSrow), (nScol), (nErow), (nEcol) are the screen coordinates.
(cColor1) is the color of the window frame.
(cColor2) is the color of the window contents.
(lTone) if .TRUE. will create a warning tone. .FALSE. is
default.
(cTitle) is the a title to display at the top of the box.
(nSlideRate) is a number from 1 to 10 to determine the speed at
which a small box starting at the current cursor location moves
across the screen to start the explode process. A value of 0
(default) will disable the sliding box. The smaller the number
the faster the sliding box will move.
(lShadow) if .TRUE. (default) will paint a shadow on the
screen.
(lPaintOnly) if .TRUE. will override the setting of
DC_EXPLMODE() and "instantly" paint the box on the screen
rather than "exploding" the box.
(lDouble) if .TRUE. will paint a double line border. A single
line border (.FALSE.) is default.
Returns:
A character string that is a "composite" of the coordinates,
colors, etc. to be used later to restore the screen with
DC_IMPLODE().
Description:
DC_EXPLODE() is used to explode a window on the screen with
optional border, colors, tone, shadow, etc.
Examples:
cSaveScrn := DC_EXPLODE(5,10,7,70,'B/W','N/W',.F.,;
' Enter a Command ',10)
cCommand := space(50)
@ 6,12 get cCommand
read
dc_implode( cSaveScrn )
Source/Library:
_DCEXPL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_implode
dc_altshadow
dc_fax()
A Fax Server based on Faxual II
Syntax:
Arguments:
(nComPort) is the Com port to use. This should be the com port of
the fax/modem.
(cLocalId) is an optional parameter. This is the default ID to
send in case no ID is entered in the LOCALID field.
(cAreaCode) is the area code of the fax server. This will strip
out all area codes in phone numbers of the same area so they will
be sent as local calls.
Description:
DC_FAX() is a "FAX SERVER" system. This requires FAXUAL2
or later. The fax server works with a database named DCFAX.DBF
and automatically processes faxes in this database when the
DC_FAX() function is executed. DC_FAX() stays in a loop and
looks for new entries into DCFAX.DBF.
DATE_REQ,D,8,0 - Date Fax should be sent
TIME_REQ,C,8,0 - Time Fax should be sent (standard Clipper
time string).
REF_NO1,C,20,0 - Reference Number 1
REF_NO2,C,20,0 - Reference Number 2
REF_NO3,C,20,0 - Reference Number 3
REF_NO4,C,20,0 - Reference Number 4
USER_NO,C,8,0 - User Number
FILE_NAME,C,60,0 - File name to send (text file). If empty
then there must be text in FAX_TEXT field.
PHONE_NMBR,C,25,0 - Phone number (including area code).
FAX_TEXT,M,10,0 - Text of fax to send. If empty, then there
must be a file attached in FILE_NAME field.
If both FAX_TEXT and FILE_NAME have entries,
FILE_NAME will be include after FAX_TEXT.
DATE_SENT,D,8,0 - The date is entered by program after fax is
successfully sent.
TIME_SENT,C,8,0 - The time string is entered by program after fax is
successfully sent.
LOCALID,C,20,0 - Fax header (usually your phone number or
company name).
BMP_FILE,C,12,0 - The name of a *.BMP (logo) file to place at the
top of the fax. File must exist in current
directory.
FONT_FILE,C,12,0 - The name of a *.XFB (font) file to use for the
text conversion. File must exist in current
directory.
RETRIES,N,2,0 - This value is entered by the program. It logs
the number of retries in trying to send the
fax.
ERROR_CODE,N,4,0 - This value is entered by the program. If the
fax was sent successfully, it will be zero,
otherwise it will be a standard FAXUAL2 error
code.
ERROR_CRIT,N,4,0 - The error will also be placed in this field if
it is a critical error and the fax will not
be retried.
Fax records may be added directly to DCFAX.DBF by using the
database in SHARED mode. This is NOT recommended for processing
a large volume of faxes. DC_Fax() not only looks for new records
in DCFAX.DBF, but it also looks for a file named DCFAXIN.DBF.
This file is the same structure as DCFAX.DBF. To process a large
number of faxes, it is recommended that you use an offline program
to create the outgoing fax records in DCFAXIN.DBF and then copy
the file to the directory containing the .EXE program that is
running DC_Fax(). This may also be accomplished with DC_FAXADD().
DC_Fax() will automatically append records from DCFAXIN.DBF/.DBT
to DCFAX.DBF then delete DCFAXIN.DBF/.DBT.
Notes:
Make sure that DCFAXIN.DBF/.DBT or DCFAXIN.DBF/.FPT are
compatabile with the data-driver used as the DC_DictRdd()
linked into the program containing the DC_Fax() function.
Examples:
// Start up Fax Server
DC_FAX( 2, 'DONNAY Software', '208' )
Source/Library:
_DCFAX.PRG/.OBJ, DCLIP.LIB
See Also:
dc_faxadd()
dc_faxadd()
Add an outgoing Fax to the Fax Server database
Syntax:
Arguments:
(cFaxFile) is the name of the .DBF file to add the fax record.
If no parameter is passed, then DCFAXIN.DBF is the default.
(cPhone) is the phone number to call (required parameter).
(dDateReq) is the date to send the fax. Today's date is default.
(cTimeReq) is the time to send the fax. Current time is default.
(cLogoFile) is the name of a .BMP file to insert at the top of
the fax. This must be a black and white only .BMP file.
(cFaxMemo) is the text of the fax to send.
(cFootFile) is an optional text file to include after the fax
memo.
(cLocalId) is the ID to print at the top of the fax (sender name).
(cRef1), (cRef2), (cRef3), (cRef4) are optional reference fields.
(cUser) is the USER ID of the person sending the fax.
(lReview) if .TRUE. will display a dialogue screen of all the
fax parameters for the operator to review before adding the fax
to the database, otherwise the fax will be added with no review.
Description:
DC_FAXADD() is used to add records to the DCFAXIN.DBF database.
This database is used with the "FAX SERVER" system - DC_FAX()
which will automatically process the faxes.
Notes:
Make sure that DCFAXIN.DBF/.DBT or DCFAXIN.DBF/.FPT are
compatabile with the data-driver used as the DC_DictRdd()
linked into the program containing the DC_Fax() function.
Examples:
// Start up Fax Server on Workstation 1 or in a Window
DC_FAX( 2, 'DONNAY Software', '208' )
// Send a fax request to the server from another workstation.
cMemo := DC_MemoBase() // Write the memo
// Send the fax
DC_FAXADD( ;
nil, ;
'208-331-2621',;
nil, ;
nil, ;
'MYLOGO.BMP',;
cMemo,;
'AGREE.TXT',;
'Donnay Software' )
Source/Library:
_DCFAXIN.PRG/.OBJ, DCLIP.LIB
See Also:
dc_fax()
dc_faxbatch()
Process a batch of outgoing Faxes to the Fax Server database
Syntax:
Arguments:
(cData) is the alias of the data file to merge.
(cFax) is the name of the .DBF file to add the fax record.
If no parameter is passed, then DCFAXIN.DBF is the default.
(cPhone) is a valid Clipper expression that is evaluated to
get the phone number. Usually this is a pointer to a database
field.
(dDate) is the date to send the fax. Today's date is default.
(cTime) is the time to send the fax. Current time is default.
(cLogo) is the name of a .BMP file to insert at the top of
the fax. This must be a black and white only .BMP file.
(cMemo) is the text of the fax to send. The contents of this
memo is merged with the data using the function DC_TEXTMERGE().
(cFoot) is an optional text file to include after the fax
memo.
(cId) is the ID to print at the top of the fax (sender name).
(cR1), (cR2), (cR3), (cR4) are optional Clipper expressions to
evaluate for storing reference information. Usually these are
pointers to database fields.
(cUser) is the USER ID of the person sending the fax.
(lReview) if .TRUE. will display a dialogue screen of all the
fax parameters for the operator to review before adding the fax
to the database, otherwise the fax will be added with no review.
(cOutP) is the output path of the DCFAXIN.DBF file that will
be created. This should be the directory that contains the
DCFAX.DBF which is being processed by the Fax server.
(nRec) is the start record of the database to merge. If no
parameter is passed the merge will start at the top of the
database.
(cQuery) is the name of an optional QUERY expression to use as
a filter on the database. This must be a query that was
previously created and stored in the DCQUERY.DBF database using
DC_QUERY().
(xScope0) and (xScope1) are an optional SCOPING condition to use
on the database. (xScope0) is the SCOPE TOP and (xScope1) is the
SCOPE BOTTOM. These values must match the type of the index key of
the current controlling index of the merge database.
(cFilt) is an optional filter expression to use on the database.
Description:
DC_FAXBATCH() is used to process a group of records in a
database and send a fax for each record. The data in each
record will be merged with the data in a memo or text file
using the DC_TEXTMERGE() function.
The database to merge with must already be opened.
Records are placed into a file named DCFAXIN.DBF which is used
by the "FAX SERVER", DC_FAX(), to send the faxes.
Notes:
Make sure that DCFAXIN.DBF/.DBT or DCFAXIN.DBF/.FPT are
compatabile with the data-driver used as the DC_DictRdd()
linked into the program containing the DC_Fax() function.
Examples:
// Start up Fax Server on Workstation 1 or in a Window
DC_FAX( 2, 'DONNAY Software', '208' )
// Send a batch of faxes to the server from another workstation.
cMemo := MemoRead( 'LETTER.TXT' ) // Load the merge memo
USE addresses INDEX names // Open the address database
// Send the faxes
DC_FAXBATCH( ;
'ADDRESSES',;
nil, ;
'ADDRESSES-)phone',;
nil, ;
nil, ;
'MYLOGO.BMP',;
cMemo,;
'AGREE.TXT',;
'Donnay Software' )
Source/Library:
_DCFAXIN.PRG/.OBJ, DCLIP.LIB
See Also:
dc_fax()
dc_feof()
Is current opened binary/text file at end-of-file?
Syntax:
Arguments:
(nHandle) is the DOS file handle returned by FOPEN().
Description:
DC_FEOF() tests whether a file pointer is at End of File.
Examples:
nHandle := fopen( 'dclip.sys' )
do while !DC_FEOF( nHandle )
? dc_freadline( nHandle )
enddo
Source/Library:
_DCF.PRG/.OBJ, DCLIP.LIB
dc_ferror()
Display the status of the last file operation
Syntax:
Arguments:
(nHandle) is the handle number of the file. This parameter
is needed only if you wish to return the file name in
@(cFileName) from the file handle.
(nErrorCode) is the error code to display. If no parameter
is passed, then the message corresponding to the code returned
by FERROR() will be displayed.
@(cFileName) is the name of a memvar to place the file name
calculated from (nHandle).
Returns:
A logical .TRUE. if the last file operation was successful, .FALSE.
otherwise.
Description:
DC_FERROR() is used to report the status of the last file
operation. This function is a front-end to the Clipper FERROR()
function that displays the error condition in a readable format
rather than simply returning a number.
Examples:
accept "Enter a file to view" to cFileName
nHandle := fopen( cFileName )
begin sequence
if DC_FERROR()
break
endif
aView := {}
do while !dc_feof()
aadd( aView, dc_freadline( nhandle ) )
enddo
fclose( nHandle )
achoice( 0,0,24,79, aView )
end sequence
Source/Library:
_DCF.PRG/.OBJ, DCLIP.LIB
dc_fieldarray()
Capture the current work area to a field definition array
Syntax:
Arguments:
(lRelFields) if true will also include all the fields in all
child relation work areas, otherwise only the fields in the
currently selected area will be returned in the array.
Returns:
An array consisting of two sub-arrays:
Sub-array #1 is a 2-dimensional array consisting of one
sub-array for each field. See RETURNS in the documentation
of DC_FIELDEDIT() for a definition of this array.
Sub-array #2 is a single-dimensional array that contains
the ALIAS() of each work-area used to create the field
arrays.
Description:
DC_FIELDARRAY() will return a field definition array of
field information captured from the current work area. A
field definition array is used with the dCLIP browsing and
editing systems to define the fields in browse and edit
screens. This array must conform to the specifications in
DCFIELDS.CH and is used to establish the browsing and
editing configuration. The browse and editing systems
get this array from the data-dictionary, however if it does
not exist in the data-dictionary then the array will be
captured from the current work area.
Examples:
USE customer
aFieldGroup := DC_FIELDARRAY()
Source/Library:
_DCFLDS.PRG/.OBJ, DCLIP.LIB
See Also:
dc_fieldedit()
dc_fieldconfig()
Edit or add a field array element
Syntax:
Source/Library:
_DCFLDS.PRG/.OBJ, DCLIP.LIB, DCFIELDS.CH
dc_fielddfn()
Create a .PRG file with FIELD definitions from Dictionary
Syntax:
Arguments:
None.
Returns:
A logical .TRUE. if the file was created successfully.
Description:
DC_FIELDDFN() will create a file named DCFIELDS.PRG. This
file will contain FIELD declarations for every field in
the DCFIELDS.DBF Field Dictionary.
Clipper applications allocate memory more efficiently if all
the fields in an application are pre-defined by the compiler
and linked into the executable program rather than added to
the symbol-table at runtime.
Source/Library:
_DCFLDS.PRG/.OBJ, DCLIP.LIB
dc_fieldedit()
A Field Definition editor
Syntax:
Arguments:
(cFieldGroup) is the name of the field group in DCFIELDS.DBF
to load and edit (up to 8 characters) or (aFieldGroup) is a
Field Group array. See RETURNS for a specification of this
array. If no parameter is passed, a pick-list of all Field
Groups in DCFIELDS.DBF will be displayed.
Returns:
A 2-dimension array consisting of 2 sub-arrays:
Sub-array #1 contains general information about this field
group.
* - Maximum Length allowed, Minimum Length is 0
Element Type Len Description
------------- ---- --- -------------------------------
1 C 8* Field Group Name
2 C 10* File Alias
3 C 50* Field Group Description
Sub-array #2 contains one sub-array for each field
definition.
See DCFIELDS.CH for the definitions of the array elements.
Element Type Len Description
------------- ---- --- --------------------------------
DCFLD_GROUP C 8* Field Group Name
DCFLD_ALIAS C 10* File Alias
DCFLD_VIRTUAL L Virtual Field = .t.
Real database field = .f.
DCFLD_NAME C 300* Field Name if Real Field
Expression if Virtual Field
DCFLD_TYPE C 2* Field Type ( C,D,L,N,M,CA,A,V )
DCFLD_LEN N Field Length
DCFLD_DEC N Field Decimals
DCFLD_ORDER N Field Order in Database
DCFLD_DESC C 100* Field Descriptor (used in browse
column headings and edit screens)
Use semi-colons (;) for multiple
lines.
DCFLD_PROMPT C 1000* Field Prompt (used in help window)
DCFLD_PICT C 100* Field Picture Clause
See Clipper TRANSFORM() function
DCFLD_VALTYPE C 1 Field Validation Type
See EDITING for more info
N - None
F - Calculated Field
X - Logical Expression
R - Range
L - File Look-Up
T - Table Look-Up
V - View (Browse) Look-Up
A - Auto-Fill
C - Choice
E - Encrypted
M - Memo Window
DCFLD_DEFAULT C 200* Field Default value
DCFLD_WHEN C 300* Field When Clause
DCFLD_VALID C 300* Field Valid Clause or Formula
DCFLD_EMPTY L Empty Value Allowed
DCFLD_ACCESS N Access Level
DCFLD_NROW N Field Display Row (EDIT only)
DCFLD_NCOL N Field Display Column (EDIT only)
DCFLD_DROW N Descriptor Display Row (EDIT only)
DCFLD_DCOL N Descriptor Display Column (EDIT only)
DCFLD_SORT N Sorting element
DCFLD_PAGE N Display Page (EDIT Only)
DCFLD_BRTAG L Tagged (BROWSE Only)
DCFLD_EDTAG L Tagged (EDIT Only)
DCFLD_BRLOCK L Locked (BROWSE Only)
DCFLD_EDLOCK L Locked (EDIT Only)
DCFLD_MSROW N Memo Start Row (EDIT Only)
DCFLD_MSCOL N Memo Start Column (EDIT Only)
DCFLD_MEROW N Memo End Row (EDIT Only)
DCFLD_MECOL N Memo End Column (EDIT Only)
DCFLD_MDISP N Memo Display Option (EDIT Only)
DCFLD_WIDTH N Column Width (BROWSE Only)
DCFLD_TOTAL N Column Total (BROWSE Only)
DCFLD_EDOPT C 50* Edit Option String
DCFLD_BRDCOLOR C 10* Descriptor Color (BROWSE Only)
DCFLD_BRFCOLOR C 10* Field Color (BROWSE Only)
DCFLD_EDDCOLOR C 10* Descriptor Color (EDIT Only)
DCFLD_EDFCOLOR C 10* Field Color (EDIT Only)
DCFLD_HELPCODE C 22* Help Code
DCFLD_VALUE X Place to store Old Field Value
DCFLD_RANGE1 C 50* Range Scope Start Value
DCFLD_RANGE2 C 50* Range Scope End Value
DCFLD_RANGE3 L Indexed Range scope (logical)
DCFLD_OLDNAME C 10* Old field name
DCFLD_OLDTYPE C 2* Old field type
Description:
DC_FIELDEDIT() is a field definition editor that maintains
the definition of each database field and their browsing,
editing and validation properties. The field definitions
are stored to an array and/or the DCFIELDS.DBF data-
dictionary file.
DC_FIELDEDIT() will also update the structure of a database
if a field definition has been changed and retain all
existing data even if a field type or name has been changed.
Notes:
The DCFIELDS.DBF database and its associated indexes will
be created by DC_FieldOpen() if they do not already exist.
Examples:
-- Example 1 --
// Load a field group from the dictionary and edit it //
DC_FIELDEDIT()
-- Example 2 --
// Edit field group "CUSTOMER"
DC_FIELDEDIT("CUSTOMER")
-- Example 3 --
// Edit a field group array //
aFieldGroup := DC_FieldPick()
aFieldGroup := DC_FIELDEDIT( aFieldGroup )
Source/Library:
_DCFLDS.PRG/.OBJ, DCLIP.LIB, DCFIELDS.CH
See Also:
FIELD EDIT
UPDATE STRUCTURE
dc_fieldimp()
Import Field Group(s) from the Import Field Dictionary
Syntax:
Arguments:
(cFieldGroup) is the name of the field group. This is a name of
up to eight (8) digits. If a group name is passed then
the DXFIELDS.DBF database will be searched and all group
items that match the group name be imported into DCFIELDS.DBF.
If no name is passed, then a pick-list of all field groups stored
in the DXFIELDS.DBF database will be displayed.
If "ALL" is passed as the group name, then all groups in the
DXFIELDS.DBF will be imported into DCFIELDS.DBF.
Returns:
A logical .TRUE. if the field group was imported successfully.
Description:
DC_FIELDIMP() is used to import field group configurations from a
DXFIELDS.DBF file into the DCFIELDS.DBF file.
Notes:
The DCFIELDS.DBF file is the data-dictionary database that
contains all field group configurations. If this file does not
exist in your default directory or path then it will be created.
The DXFIELDS.DBF file is the data-dictionary database that contains
all field groups that were exported from another system.
Source/Library:
_DCFLDS.PRG/.OBJ, DCLIP.LIB
See Also:
FIELD IMPORT
dc_fieldload()
Load a field group array from the field dictionary
Syntax:
Arguments:
(cFieldGroup) is the name of the field group in DCFIELDS.DBF
to load (up to 8 characters). If no parameter is passed, a
pick-list of all Field Groups in the DCFIELDS.DBF dictionary
will be displayed.
(lCache) if .TRUE. (default) will save the group to a static
(cache) array so the next time it is requested it will
be reloaded from the cache for faster speed. If .FALSE. then
it will not be saved to the static array.
(lMessage) if .TRUE. (default) will display an error message
if the Field Group could not be loaded or does not exist
in the dictionary file. If .FALSE, then no error message
will be displayed.
(lCreateDbf) if .TRUE. (default) will create any empty
DCFIELDS.DBF if it cannot be found. If .FALSE. the
database will not be created.
(lErrorOk) if .FALSE. (default) will return a NIL if the
field array being loaded does not match the structure of the
currently selected database. If .TRUE. then the field array
loaded from the dictionary will always be returned.
(lImport) if .TRUE. will attempt to load the array from a
an import file named DXFIELDS.DBF. If .FALSE. (default) then
the array will be loaded from the standard DCFIELDS.DBF
dictionary.
Returns:
A field group array that conforms to the specifications in
the RETURNS section of the function DC_FIELDEDIT().
Description:
DC_FIELDLOAD() is used to retrieve a field group from the
DCFIELDS.DBF field group dictionary and store it to an array.
Examples:
aFieldGroup := DC_FIELDLOAD()
aFieldGroup := DC_FieldEdit( aFieldGroup )
DC_FieldSave( aFieldGroup )
Source/Library:
_DCFLDS.PRG/.OBJ, DCLIP.LIB
See Also:
dc_fieldedit()
dc_fieldpick()
Pick a field group from the field dictionary
Syntax:
Arguments:
(cTitle) is the title to display on the pick-list box.
Returns:
A character string.
Description:
DC_FIELDPICK() is used to pick the name of a field group
from the Field Group dictionary.
Examples:
cFieldGroup := DC_FIELDPICK()
IF !Empty(cFieldGroup)
aFieldGroup := DC_FieldEdit( cFieldGroup )
ENDIF
Source/Library:
_DCFLDS.PRG/.OBJ, DCLIP.LIB
See Also:
dc_fieldedit()
dc_fields()
Pick a field from a list of primary/relational fields
Syntax:
Arguments:
(nStCol) is the starting column of the display ( 0 - 40 ).
(cValidType) is a string containing valid field types to
return. If the operator selects a field type which is not in
the passed string, a message will be displayed showing that the
selected field is not valid for this operation. If this
parameter is not used then all fields will be valid.
@(cDescription) is the name of a memvar to place the
decription of the field selected. This description will be
the same as the field name unless descriptors were previously
loaded into the DCDICT array with DC_DICTADD().
(cTitle) is the title to display at the top of the field pick
list. If no parameter is passed, then "Select a Field" will
be displayed.
(lExplode) if .TRUE. (default) will explode a box around the
picklist with the title and scroll-bars. If .FALSE., then
only the pick-list items will be updated. This parameter is
provided to allow DC_FIELDS() to be used in a loop.
(lExit) if .TRUE. will display the field pick-list but then
immediately exit with the field-list remaining on the screen.
Returns:
The field name of the field selected.
Description:
DC_FIELDS() is used to pop-up a pick-list of field names from
the parent table and all child tables.
Examples:
local cSaveScreen, cString, cFieldName, GetList := {}
cSaveScreen := dc_expl(10,5,16,35)
cString := space(20)
@ 11,7 say 'Enter search string'
@ 12,7 get cString
read
@ 14,7 say 'Pick a Character or Memo'
@ 15,7 say 'field to search'
cFieldName := DC_FIELDS( 40, 'CM' )
dc_impl(cSaveScreen)
if !empty(cFieldName)
loca for upper(alltrim(cString)) $ upper(&cFieldName)
endif
Source/Library:
_DCFLDS.PRG/.OBJ, DCLIP.LIB
dc_fieldsave()
Save a field group array to the field dictionary
Syntax:
Arguments:
(aFieldGroup) is a field group array that conforms to
the specifications in the RETURNS section of the function
DC_FIELDEDIT().
Returns:
A logical .TRUE. if the field group was saved successfully,
.FALSE. otherwise.
Description:
DC_FIELDSAVE() is used to save a field group array to the
DCFIELDS.DBF dictionary file.
Examples:
cFieldGroup := DC_FieldPick()
aFieldGroup := DC_FieldLoad( cFieldGroup )
aFieldGroup := DC_FieldEdit( aFieldGroup )
DC_FIELDSAVE( aFieldGroup )
Source/Library:
_DCFLDS.PRG/.OBJ, DCLIP.LIB
See Also:
dc_fieldedit()
dc_fieldsort()
Establish whether Field Pick-lists should be sorted
Syntax:
Arguments:
(lMode) if .TRUE. will sort fields alphabetically. The
default is .FALSE.
Returns:
The current mode.
Description:
DC_FIELDSORT() is used to provide option of Field Pick-lists
sorted by field name or description rather than the default
of listing by field order in the database. dCLIP uses the
function DC_FIELDS() to pop-up field pick-lists in it's Query
system, browse/edit system and many other places.
DC_FIELDSORT(.t.) will force DC_FIELDS() to display the fields
in alphabetical order rather than field-list order.
If a dictionary array was previously loaded with DC_DICTADD(),
then the pick-list will be sorted by order of the field
definitions rather than field names.
Examples:
use customer
DC_FIELDSORT(.t.)
cField := DC_Fields()
Source/Library:
_DCFLDS.PRG/.OBJ, DCLIP.LIB
See Also:
dc_fields()
dc_filearray()
Capture work area(s) to a file definition array
Syntax:
Arguments:
(lAllAreas) if .TRUE. (default) will also include all the
files in all open work areas, otherwise only the files in the
currently selected area will be returned in the array.
(lVerbose) if .TRUE. (default) will display information
being captured in a window, otherwise nothing will be
displayed.
Returns:
An array consisting of three sub-arrays:
Sub-array #1 is an array of two elements: Element #1
contains the ALIAS() of the current work area and element
#2 is a null string.
Sub-array #2 is a 2-dimensional array consisting of one
sub-array for each file, index or relation. See RETURNS in
the documentation of DC_FILEEDIT() for a definition of this
array.
Sub-array #3 is a set of 3 sub-arrays:
Element #1 is an array containing the current Browse
configuration of all work areas (DCBROWSE).
Element #2 is an array containing the current Edit
configuration of all work areas (DCEDIT).
Element #3 is an array containing the current Import
configuration of all work areas (DCIMPORT).
Description:
DC_FILEARRAY() will return a file definition array of
file information captured from the current work area. A
file definition array is used to define files, indexes and
relations for later restoring the work areas from the
contents of the array.
Examples:
use customer shared readonly
set index to custname, custnmbr
aFileGroup := DC_FILEARRAY()
Source/Library:
_DCFILES.PRG/.OBJ, DCLIP.LIB
See Also:
dc_fileedit()
dc_fileedit()
A Database File / Work area Definition editor
Syntax:
Arguments:
(cFieldGroup) is the name of the field group in DCFIELDS.DBF
to load and edit (up to 8 characters) or (aFieldGroup) is a
Field Group array. See RETURNS for a specification of this
array. If no parameter is passed, a pick-list of all Field
Groups in DCFIELDS.DBF will be displayed.
Returns:
A 2-dimension array consisting of 2 sub-arrays:
See DCWORK.CH for the definitions of the array elements.
Sub-array #1 contains general information about this file
group.
* - Maximum Length allowed, Minimum Length is 0
Element Type Len Description
------------- ---- --- ------------------------------
DCWORK_GROUPNAME C 8* File Group Name
DCWORK_GROUPDESC C 50* File Group Description
DCWORK_GROUPDEFA C 100* Default Directory for files
Sub-array #2 contains one sub-array for each file, index
or relation definition.
Element Type Len Description
------------- ---- --- --------------------------------
DCWORK_TYPE C 1 Item Type
E - Open Database exclusive
S - Open Database shared
I - Open Index
R - Set a relation
DCWORK_NAME C 150* File Name
DCWORK_DESC C 50* Description of File
DCWORK_ALIAS C 10* Alias Name
DCWORK_RELALIAS C 10* Relational Alias Name
DCWORK_FIELD1 C 10* Relational Field
DCWORK_KEY C 300* Index Key Expression
DCWORK_RECNO N Database record to select
DCWORK_FILTER C 500* Database filter expression
DCWORK_RDD C 10* Name of RDD (Data-Driver to use)
DCWORK_SUPERRDD C 10* Name of SUPER RDD (Data-Driver)
DCWORK_INDEXNO N Index Order to select
DCWORK_TAGNAME C 10* Index Tag Name to select
DCWORK_INDEXFOR C 500* Index Condition expression
DCWORK_DESCEND L Descending Index - .T.
DCWORK_UNIQUE L Unique Index - .T.
DCWORK_ISCDX L Combined Index - .T.
DCWORK_BROWSE C 10* Browse Configuration Name
DCWORK_EDIT C 10* Edit (Data-Entry) Configuration
DCWORK_IMPORT C 10* Import Configuration
DCWORK_DICT C Unused (reserved)
Description:
DC_FILEDEDIT() is an editor that maintains the definition of
each database and it's indexes and relations.
Each file group is stored in the DCFILES.DBF dictionary file.
This database has the same structure as *.DCW (Work) files.
A file group contains all the information necessary to
restore work areas for editing and browsing. The data
dictionary contains information for opening databases and
indexes (or creating indexes that do not exist).
Notes:
The DCFILES.DBF database and its associated indexes will
be created by DC_FileOpen() if they do not already exist.
Examples:
-- Example 1 --
// Load a file group from the dictionary and edit it //
DC_FILEEDIT()
-- Example 2 --
// Edit file group "CUSTOMER"
DC_FILEEDIT("CUSTOMER")
-- Example 3 --
// Edit a file group array //
aFileGroup := DC_FilePik()
aFileGroup := DC_FILEEDIT( aFileGroup )
Source/Library:
_DCFILES.PRG/.OBJ, DCLIP.LIB, DCWORK.CH
dc_fileimp()
Import File Group(s) from the Import File Dictionary
Syntax:
Arguments:
(cFileGroup) is the name of the file group. This is a name of
up to eight (8) digits. If a group name is passed then
the DXFILES.DBF database will be searched and all group
items that match the group name be imported into DCFILES.DBF.
If no name is passed, then a pick-list of all file groups stored
in the DXFILES.DBF database will be displayed.
If "ALL" is passed as the group name, then all groups in the
DXFILES.DBF will be imported into DCFILES.DBF.
Returns:
A logical .TRUE. if the file group was imported successfully.
Description:
DC_FILEIMP() is used to import file group configurations from a
DXFILES.DBF file into the DCFILES.DBF file.
Notes:
The DCFILES.DBF file is the data-dictionary database that
contains all file group configurations. If this file does not
exist in your default directory or path then it will be created.
The DXFILES.DBF file is the data-dictionary database that contains
all file groups that were exported from another system.
Source/Library:
_DCFILES.PRG/.OBJ, DCLIP.LIB
See Also:
FILE IMPORT
dc_filelist()
Return an array of files chosen by operator
Syntax:
Arguments:
(aWildCard) is an array of character strings. Each character
string defines the wildcard for files to include in the
directory pick-list. Ex: { '*.IDX','*.CDX' }
(cPath) is the start directory to display in the directory
pick-list.
(cTitle) is the title to display in the file "get-input" box.
Returns:
An array of character strings.
Description:
DC_FILELIST() is used to create an array of files from a
set entered by an operator or chosen from a picklist of
files.
Examples:
aFiles := DC_FILELIST( {'*.COM','*.EXE'} )
Source/Library:
_DCCHOICE.PRG/.OBJ, DCLIP.LIB
See Also:
dc_dirpick()
dc_fileload()
Load a file group array from the file (work area) dictionary
Syntax:
Arguments:
(cFileGroup) is the name of the file group in DCFILES.DBF
to load. If no parameter is passed, a pick-list of all
File Groups in the DCFILES.DBF dictionary will be displayed.
(lCache) if .TRUE. (default) will save the group to
a static array so the next time it is requested it will
be reloaded from the static array (cache) for faster speed.
If .FALSE. then it will not be save to the cache.
(lWorkFile) if .TRUE. will restore the file group from the
currently open database rather than the DCFILES.DBF data
dictionary. The currently open database must have the same
structure as DCFILES.DBF or any *.DCW work file. If .FALSE.
(default) then the file group is restored from the
DCFILES.DBF dictionary.
Returns:
A field group array that conforms to the specifications in
the RETURNS section of the function DC_FIELDEDIT().
Description:
DC_FILELOAD() is used to retrieve a file (work area) group
from the DCFILES.DBF file group dictionary or a *.DCW work
file and store it to an array.
Examples:
-- Example 1 --
/* Restore work areas from a work file */
USE customer.dcw
DC_FILELOAD( nil,.t.,.t. )
-- Example 2 --
/* Restore Work areas from file dictionary */
DC_FILELOAD( 'CUSTOMER' )
-- Example 3 --
/* Restore and Edit a file group array //
cFileGroup := DC_FilePik()
aFileGroup := DC_FILELOAD( cFileGroup )
aFileGroup := DC_FileEdit( aFileGroup )
Source/Library:
_DCFILES.PRG/.OBJ, DCLIP.LIB
See Also:
dc_fileedit()
dc_filepick()
A Pick-List to choose a file
Syntax:
Arguments:
(nStrow), (nStCol), (nEnRow) are the screen coordinates. If
none are passed then the window will be centered in the screen.
(aWildCard) is an array of file-spec character strings
representing the files to display in the file pick-list.
Returns:
The name of the file chosen.
A null-string will be returned if the operation is cancelled.
Description:
DC_FILEPICK() is used to select a file from a picklist.
The files included in the picklist will come from the
currently selected DOS directory.
Examples:
DC_FILEPICK( ,,,{'*.COM','*.EXE'} )
Source/Library:
_DCCHOICE.PRG/.OBJ, DCLIP.LIB
See Also:
dc_dirpick()
dc_filepik()
Pick a file (work-area) group from the file dictionary
Syntax:
Arguments:
(cTitle) is the title to display on the pick-list box.
Returns:
A character string.
Description:
DC_FILEPIK() is used to pick the name of a file group from
the File Group (Work Area) dictionary.
Examples:
cFileGroup := DC_FILEPIK()
IF !Empty(cFileGroup)
aFileGroup := DC_FileEdit( cFileGroup )
ENDIF
Source/Library:
_DCFILES.PRG/.OBJ, DCLIP.LIB
See Also:
dc_fileedit()
dc_filesave()
Save Work area definition array to dictionary
Syntax:
Arguments:
(aFileGroup) is a file group array that conforms to the
specification of the array returned by DC_FILEEDIT().
(lWorkFile) if .TRUE. will save the file group to the
currently open database rather than the DCFILES.DBF data
dictionary. The currently open database must be empty
and have the same structure as DCFILES.DBF or any *.DCW
work file. If .FALSE. (default) then the file group is
saved to the DCFILES.DBF dictionary and will overwrite
any file group with the same name.
(lWorkAreas) if .TRUE. will save the information about
currently open workareas rather than a passed array.
The (aFileGroup) parameter is not needed and will be
ignored if (lWorkAreas) is .TRUE. The default is .FALSE.
(cFileGroup) is needed only if (lWorkAreas) is .TRUE. This
is the name of the file group (up to 8 characters) to assign
to the file group.
Returns:
A 2-dimension array consisting of 2 sub-arrays:
Sub-array #1 contains general information about this file
group.
* - Maximum Length allowed, Minimum Length is 0
Element Type Len Description
------------- ---- --- -------------------------------
1 C 8* File Group Name
2 C 50* File Group Description
Sub-array #2 contains one sub-array for each file, index
or relation definition.
See DCWORK.CH for the definitions of the array elements.
Element Type Len Description
------------- ---- --- --------------------------------
DCWORK_TYPE C 1 Item Type
E - Open Database exclusive
S - Open Database shared
I - Open Index
R - Set a relation
DCWORK_NAME C 150* File Name
DCWORK_DESC C 50* Description of File
DCWORK_ALIAS C 10* Alias Name
DCWORK_RELALIAS C 10* Relational Alias Name
DCWORK_FIELD1 C 10* Relational Field
DCWORK_KEY C 300* Index Key Expression
DCWORK_RECNO N Database record to select
DCWORK_FILTER C 500* Database filter expression
DCWORK_RDD C 10* Name of RDD (Data-Driver to use)
DCWORK_SUPERRDD C 10* Name of SUPER RDD (Data-Driver)
DCWORK_INDEXNO N Index Order to select
DCWORK_TAGNAME C 10* Index Tag Name to select
DCWORK_INDEXFOR C 500* Index Condition expression
DCWORK_DESCEND L Descending Index - .T.
DCWORK_UNIQUE L Unique Index - .T.
DCWORK_ISCDX L Combined Index - .T.
DCWORK_BROWSE C 10* Browse Configuration Name
DCWORK_EDIT C 10* Edit (Data-Entry) Configuration
DCWORK_IMPORT C 10* Import Configuration
DCWORK_DICT C Unused (reserved)
Description:
DC_FILESAVE() is used to save the contents of a file group
array or the current workareas to a *.DCW (work file) or to
the DCFILES.DBF data-dictionary.
Examples:
-- Example 1 --
/* Save all work areas to a work file */
dbCreate( 'CUSTOMER.DCW', DC_WorkStru() )
USE customer.dcw
DC_FILESAVE( ,.t.,.t.,'CUSTOMER' )
-- Example 2 --
/* Save Work areas to file dictionary */
DC_FILESAVE( ,.f.,.t.,'CUSTOMER' )
-- Example 3 --
/* Edit and Save a file group array //
cFileGroup := DC_FilePik()
aFileGroup := DC_FileEdit( cFileGroup )
DC_FILESAVE( aFileGroup )
Source/Library:
_DCFILES.PRG/.OBJ, DCLIP.LIB, DCWORK.CH
See Also:
dc_fileedit()
dc_filevalid()
A function to validate file names entered into GETS
Syntax:
Arguments:
(cFileName) is the value in the input GET to validate. If a
NIL is passed then the oGet:VarGet() value will be used.
If the value in the get is empty, a pick-list of available
files will be displayed.
(nStrow),(nStcol),(nEnrow),(nEncol) are the screen
coordinates to display the pick-list.
(cWildcard) is the type of files to include in the list.
Example: "*.DBF"
(aWildCard) is a single-dimensional array containing
character strings with the type of files to contain in
the list. Example: { "*.PRG","*.TXT","*.DCB" }
(cDirectory) is the DOS directory. If no argument is
given, then the current DOS directory will be used. The
user can choose a different directory from the pick-list.
If the current DEFAULT directory is to be used, then
pass the argument SET(_SET_DEFAULT).
(lWide) if .TRUE. will display the file list in WIDE format
using DC_CHOICE(). If .FALSE. (default) the file list will
be displayed in a format that includes pick-lists for
directories, drives, and files using DC_DIRPICK().
(lEmptyOK) if .TRUE. will not pop-up a file pick list if
the GET is left empty. .FALSE. is the default.
(lNotFoundOK) if .TRUE. will return a logical .TRUE. even
if the file was not found. The default is .FALSE. If
this parameter is .TRUE., then the file pick-list will not
be displayed unless the operator presses (CTRL-ENTER) or
double-clicks the mouse.
Returns:
A .TRUE. if the file name entered is a valid file and exists
in the directory or if the operator chooses a file from the
pick-list.
A .FALSE. if the file name entered is not valid or the
operator presses ESCape.
The name of the file chosen in the variable @(cFileName).
Description:
DC_FILEVALID() is used as a "VALID" in GET statements
when entering file names. If no file name is entered
or the GET is double-clicked, then the DC_DIRPICK() or
DC_CHOICE() function will be called to choose a file.
Examples:
@ 10,10 say 'Enter FileName ' GET cFileName VALID ;
DC_FILEVALID( @cFileName,,,,,'*.DBF',SET(_SET_DEFAULT) )
Source/Library:
_DCCHOIC.PRG/.OBJ, DCLIP.LIB
See Also:
dc_dirpick()
dc_filock()
Lock the current data file
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 file cannot be locked. (default) or if .false.
will not display an error message to the operator.
Returns:
A logical .TRUE. if the file is locked, .FALSE. otherwise.
Description:
DC_FILOCK() is used to lock the currently selected file before
attempting to perform database operations that modify the data
in mulitiple records.
Examples:
use customer
if DC_FILOCK( 5 )
replace print_flag with .F. for print_flag
dc_unlock()
endif
Source/Library:
_DCLOCK.PRG/.OBJ, DCLIP.LIB
dc_find()
Find a record from a pick-list of available indexes
Syntax:
Arguments:
(cFieldSel) is the name of a reference field to display in a
pick-list in the event that DC_FIND() finds more than one
record that matches the entered value. If no argument is
given, then the first field in the database will be used as the
reference.
Description:
DC_FIND() is a high-level function that scans all index keys
and creates an input screen to allow the user to find
information by simply typing in the value in the box next to
the associated index key. This is a quick method of finding
information in a database that has multiple index files open or
multiple index tags in a combined index.
After the user enters in the value next to the referenced
index, the database is checked to see if more than one record
matches the entered value. If duplicates are found, then a
pick-list of records is displayed to allow the user to choose
one.
Examples:
use customer index cust_nmbr, cust_name, cust_code
DC_FIND()
Source/Library:
_DCFIND.PRG/.OBJ, DCLIP.LIB
See Also:
FIND
dc_fldtype()
Return the type of a field from it's name
Syntax:
Arguments:
(cFieldName) is the name of the database field.
Returns:
A character value.
Description:
DC_FLDTYPE() is basically a front-end to Clipper's TYPE() function
which functions identical to TYPE() unless the currently used RDD
is Flex-File. Flex-File supports new types of fields such as
BLANK (B) and ARRAY (A), and it will report the field type as "C"
when character strings are saved to MEMO fields. This irregular
reporting of the field type makes dCLIP's browsing/editing system
not behave as desired, therefore, DC_FLDTYPE() returns the type
of field necessary to make dCLIP's functions work properly.
Examples:
append blank
? type('memo'), DC_FLDTYPE('memo')
B B
repl memo with directory()
? type('memo'), DC_FLDTYPE('memo')
A A
repl memo with 'string'
? type('memo'), DC_FLDTYPE('memo')
C M
Source/Library:
_DCAREA1.PRG/.OBJ, DCLIP.LIB
dc_fmapdelete()
Delete a Field Map in the Field Map Dictionary
Syntax:
Arguments:
(cMapGroup) is the name of the field map group in DCMAPS.DBF
to delete (up to 8 characters). If no parameter is passed,
a pick-list of all Map Groups in DCMAPS.DBF will be displayed.
Returns:
A logical .TRUE. if the field map was successfully deleted,
otherwise a logical .FALSE.
Description:
DC_FMAPDELETE() is used to delete a field map in the
DCMAPS.DBF Field Map dictionary file.
Examples:
-- Example 1 --
// Delete the "TESTING" field map
DC_FMAPDELETE("TESTING")
Source/Library:
_DCFMAP.PRG/.OBJ, DCLIP.LIB, DCFIELDS.CH
See Also:
dc_fmapedit()
dc_fmapedit()
A Field Map editor
Syntax:
Arguments:
(cMapGroup) is the name of the field map group in DCMAPS.DBF
to load and edit (up to 8 characters) or (aMapGroup) is a
Map Group array. See RETURNS for a specification of this
array. If no parameter is passed, a pick-list of all Map
Groups in DCMAPS.DBF will be displayed.
Returns:
A multi-dimensional array consisting of 1 sub-array for
each mapped item:
See _DCFMAP.CH for the definitions of the array elements.
An asterisk (*) denotes the "maximum" allowable length.
Element Type Len Description
------------- ---- --- --------------------------------
cMAP_SUBGROUP C 10* Sub-Group. Use this element for
"conditional-mapping" based on
a sub-group name passed to the
DC_FMapImport() function. If
left empty then it will be used
unconditionally.
cMAP_FROMFIELD C 10* The name of to field to extract
information FROM.
cMAP_TOFIELD C 10* The name of the field to write
information TO.
cMAP_FROMALIAS C 10* The ALIAS name of the database
work area to select before
capturing the FROM field info.
cMAP_TOALIAS C 10* The ALIAS name of the database
work area to select before writing
the TO field info.
cMAP_TRANSFORM C 100* An optional Tranformation equation
for converting the FROM data before
writing it to the TO field. Ex:
DC_CAPFIRST((f)). NOTE: The (f)
performs a field name replacement
with the name of the FROM field.
Any literal name of any field may
also be used in the equation.
cMAP_REPLMODE C 1 The mode for replacing data in the
target field:
R - Replace field ALWAYS (default)
A - Append to existing data
E - Replace field only if EMPTY
nMAP_TAG L 1 Reserved
Description:
DC_FMAPEDIT() is a field map editor that maintains the
definition of how fields from databases are mapped to
fields in other databases. Field maps are used for
solving complex importing/exporting projects in which data
from several databases must be "merged" into a single
database, or data from a single database must be transferred
to multiple databases. Field Maps can be used to append
a group of new records to a "target" database or to
simply move data between the current record of several
databases to several other databases. In a data-driven
system, Field Maps solve the problem of filling in default
information during data-entry, for example, when creating
a new record or when trying to accomplish a complex
validation technique.
Field Map arrays can be passed to DC_FMapImport() to
accomplish the actual data replacement.
Notes:
The DCMAPS.DBF database and its associated indexes will
be created if they do not already exist.
Examples:
-- Example 1 --
// Load a field map group from the dictionary and edit it //
DC_FMAPEDIT()
-- Example 2 --
// Edit field map group "CUSTOMER"
DC_FMAPEDIT("CUSTOMER")
-- Example 3 --
// Edit a field map group array //
aFMapGroup := DC_FMapPick()
aFMapGroup := DC_FMAPEDIT( aFMapGroup )
Source/Library:
_DCFMAP.PRG/.OBJ, DCLIP.LIB, DCFIELDS.CH
See Also:
dc_fmapimport()
dc_fmapimport()
Import or Replace data fields based on a Field Map
Syntax:
Arguments:
(aMapGroup) is a field map array that conforms to the
specifications documented in RETURNS for the function
DC_FMAPEDIT().
(cSubGroup) is the name of the map sub-group to include in
the mapping process for the purpose of "conditional mapping".
For example, let's say you have created a field map that
is to be used for filling in default information in a
CONTACTS.DBF database every time a new record is added to
the database. The field map must map information from one
of 5 different database sources into the CONTACTS.DBF
depending on a the TYPE of contact being made. The value
in the TYPE field would be passed as (cSubGroup) to insure
that the correct mapping sub-group would be used. Items
in the map array which have an empty sub-group will always
be mapped regardless of the (cSubGroup) value passed.
(lAppendAll) if .TRUE. will traverse the PARENT database
(defined in the Field Map array) starting at the current
record pointer and all the way to the End of the file.
For each record in the PARENT file a new record will be
added to the TARGET file before the mapping process is
accomplished. If (lAppendAll) is .FALSE. (default), then
mapping and replacement is accomplished based only on the
existing database pointers. NOTE: DC_FMapImport() will use
any existing filter or scope condition that has been set
on the PARENT database.
(lWorking) if .TRUE. will display a "Working þþþ" progress
indicator which is updated every .3 seconds while records
are being appended and mapped. This parameter is ignored
if (lAppendAll) is .FALSE.
Returns:
A logical .TRUE. if all fields defined in the field map
were replaced successfully, otherwise a logical .FALSE.
Description:
DC_FMAPIMPORT() is used to move data between databases
based on a field map array that was previously created with
DC_FMAPEDIT(). Field maps are used for solving complex
importing/exporting projects in which data from several
databases must be "merged" into a single database, or data
from a single database must be transferred to multiple
databases. Field Maps can be used to append a group of
new records to a "target" database or to simply move data
between the current record of several databases to several
other databases. In a data-driven system, Field Maps solve
the problem of filling in default information during data-
entry, for example, when creating a new record or when
trying to accomplish a complex validation technique.
DC_FMAPIMPORT() automatically locks each record of each
work area that is being mapped and then removes the lock
from the records after completion of the replacements.
Examples:
/* -- Open a group of related files -- */
DC_WorkRestore("MYSYSTEM")
/* -- Add a new "P" record to the CONTACTS database -- */
APPEND BLANK
REPLACE CONT_TYPE WITH "P"
/* -- Load the "CONTACTS" field map array -- */
aMapGroup := DC_FMapLoad("CONTACTS")
/* -- Make all replacements defined by field map -- */
DC_FMAPIMPORT(aMapGroup,"P")
Source/Library:
_DCFMAP.PRG/.OBJ, DCLIP.LIB, DCFIELDS.CH
See Also:
dc_fmapedit()
dc_fmapload()
Load a Field Map array from the Field Map Dictionary
Syntax:
Arguments:
(cMapGroup) is the name of the field map group in DCMAPS.DBF
to load (up to 8 characters).
(lCache) if .TRUE. (default) will save the group to a static
(cache) array so the next time it is requested it will
be reloaded from the cache for faster speed. If .FALSE. then
it will not be saved to the static array.
(lImport) if .TRUE. will attempt to load the array from a
an import file named DXMAPS.DBF. If .FALSE. (default) then
the array will be loaded from the standard DCMAPS.DBF
dictionary.
Returns:
A multi-dimensional array consisting of 1 sub-array for
each mapped item. See RETURNS in DC_FMAPEDIT() for a
definition of this array.
Description:
DC_FMAPLOAD() is used to load an array with field map data
from the DCMAPS.DBF Field Map dictionary for later passing
to DC_FMAPEDIT() for editing, or DC_FMAPIMPORT() for
importing data between multiple databases.
Notes:
The DCMAPS.DBF database and its associated indexes will
be created if they do not already exist.
Examples:
-- Example 1 --
// Load a field map group from the dictionary and edit it //
aFmapGroup := DC_FMAPLOAD()
aFmapGroup := DC_FMapEdit(aFmapGroup)
-- Example 2 --
// Replace field data based on the "SX" subgroup in field
// Field Map "CUSTOMER"
aFmapGroup := DC_FMAPLOAD("CUSTOMER")
DC_FMapImport(aFmapGroup,"SX")
Source/Library:
_DCFMAP.PRG/.OBJ, DCLIP.LIB, DCFIELDS.CH
See Also:
dc_fmapimport()
dc_fmappick()
Choose a Field Map name from Field Map Dictionary PickList
Syntax:
Arguments:
(cTitle) is the title to display at the top of the pick-list.
If no parameter is given, then a default title will be
displayed.
(lImport) if .TRUE. will display a list of maps in the import
file named DXMAPS.DBF. If .FALSE. (default) then the list will
be loaded from the standard DCMAPS.DBF dictionary.
Returns:
A character string.
Description:
DC_FMAPPICK() is used to choose a field map name from a
pick-list of names in the DCMAPS.DBF or DXMAPS.DBF field map
dictionary file.
Notes:
The DCMAPS.DBF database and its associated indexes will
be created if they do not already exist.
Examples:
cFmapGroup := DC_FMAPPICK()
aFmapGroup := DC_FmapLoad(cFmapGroup)
DC_FMapImport(aFmapGroup)
Source/Library:
_DCFMAP.PRG/.OBJ, DCLIP.LIB, DCFIELDS.CH
dc_fmapsave()
Save a Field Map array to the Field Map Dictionary
Syntax:
Arguments:
(aMapGroup) is a field map array that conforms to the
specifications documented in RETURNS for the function
DC_FMAPEDIT().
(lExport) if .TRUE. will save the array to an export file
named DXMAPS.DBF. If .FALSE. (default) then the array will
be saved to the standard DCMAPS.DBF dictionary.
Returns:
A logical .TRUE. if the map was successfully saved,
otherwise a logical .FALSE.
Description:
DC_FMAPLOAD() is used to load an array with field map data
from the DCMAPS.DBF Field Map dictionary for later passing
to DC_FMAPEDIT() for editing, or DC_FMAPIMPORT() for
importing data between multiple databases.
Notes:
The DCMAPS.DBF database and its associated indexes will
be created if they do not already exist.
Examples:
-- Example 1 --
// Load a field map group from the standard DCMAPS.DBF
// dictionary, edit the map, then export it to the
// DCXMAPS.DBF export dictionary.
aFmapGroup := DC_FMapLoad()
aFmapGroup := DC_FMapEdit(aFmapGroup)
DC_FMapSave(aFmapGroup,.t.)
Source/Library:
_DCFMAP.PRG/.OBJ, DCLIP.LIB, DCFIELDS.CH
See Also:
dc_fmapimport()
dc_fornext()
Evaluate list of expressions for specified range of numbers
Syntax:
Arguments:
(nStart) is the starting value to be assigned to a variable
which will be incremented for each iteration of a FOR...NEXT
loop.
(nEnd) is the ending value.
The incremental value will be passed to the (bEval) code block
for each iteration of the loop.
(nStep) is the incremental value. The default is 1.
(bEval) is a code block to evaluate for each iteration of the
loop.
(bWhile) is an code block which must evaluate to .true. to
continue the loop, otherwise the loop will be terminated.
Returns:
NIL
Description:
DC_FORNEXT() is a "function" replacement for FOR...NEXT loops
to be used when a function is needed, i.e. for calling via
macro, code blocks, etc.
Examples:
bEval := { | x | qout(x, sqrt(x) ) }
bWhile := { || inkey()#27 }
DC_FORNEXT( 100, 1000, 5, bEval, bWhile )
Source/Library:
_DCEVAL.PRG/.OBJ, DCLIP.LIB
See Also:
FOR
dc_foxrdd()
Get the best RDD to use for FoxPro compatability
Syntax:
Arguments:
None.
Returns:
A character value.
Description:
DC_FOXRDD() returns the name of the best RDD to use for .CDX
compatability only if the RDD has been linked into the program
and is usable on the Default drive.
CASE DC_ISRDD( 'DBFCDXAX' ) .AND. AX_Loaded(Curdrive())
cRdd := 'DBFCDXAX'
CASE DC_ISRDD( 'FORTRESS' )
cRdd := 'FORTRESS'
CASE DC_ISRDD( 'COMIX' )
cRdd := 'COMIX'
CASE DC_ISRDD( 'DBFSIX' )
cRdd := 'DBFSIX'
CASE DC_ISRDD( 'SIXCDX' )
cRdd := 'SIXCDX'
OTHERWISE
cRdd := 'DBFCDX'
Examples:
USE MYFILE RDD (DC_FoxRdd())
Source/Library:
_DCRDD.PRG/.OBJ, DCLIP.LIB
dc_freadline()
Read a line of text from a file
Syntax:
Arguments:
(nHandle) is a file handle returned by FOPEN() or FCREATE().
Returns:
A character string equivalent to the contents of the current text
line in the open ascii file.
Description:
DC_FREADLINE() is used to read a line of text from a text file
and automatically move the file pointer to the start of the
next line.
Examples:
local aView := {}
cls
accept "Enter a file to view " to cFileName
nHandle := fopen( cFileName )
do while !dc_feof( nHandle )
aadd( aView, DC_FREADLINE( nhandle ) + ' ' )
enddo
fclose( nHandle )
achoice( 0,0,24,79, aView )
Source/Library:
_DCF.PRG/.OBJ, DCLIP.LIB
dc_frmcolumns()
Edit report form columns from a report form array
Syntax:
Arguments:
(aReportInfo) is a multi-dimensional array with the report form
information. See DC_FRMSTRU() for a description of this array.
(cFileName) is an optional parameter. This is the name of the
report file which will be created to use as a reference on the
editor screen.
Returns:
A multi-dimensional array containing the modified contents of
the original array.
Description:
DC_FRMCOLUMNS() is used to edit the columns of a report form
array. A report form array defines the information in a report
form file (.FRM) file.
Examples:
aReport := dc_frmstru( 'CUSTOMER.FRM' ) // Create report array
do while .t.
@ 10,10 prompt 'Edit form layout'
@ 11,10 prompt 'Edit form columns'
@ 12,10 prompt 'Save report form'
menu to nChoice
do case
case nChoice = 1
dc_frmlayout( aReport, 'CUSTOMER.FRM' ) // edit layout
case nChoice = 2
DC_FRMCOLUMNS( aReport, 'CUSTOMER.FRM' ) // edit columns
case nChoice = 3
dc_frmcreate( 'CUSTOMER.FRM', aReport ) // save report
exit
endcase
enddo
Source/Library:
_DCRFORM.PRG/.OBJ
dc_frmcreate()
Create a .FRM report file from a report form array
Syntax:
Arguments:
(cFileName) is the name of the file to create.
(aReportInfo) is a multi-dimensional array with information
about the report form. See DC_FRMSTRU() for a description of a
report form array.
Returns:
A logical .TRUE. if the form is created with no errors, .FALSE.
otherwise.
Description:
DC_FRMCREATE() is used to create a report form file (.FRM) from
a report form array.
Examples:
aReport := dc_frmstru( 'CUSTOMER.FRM' ) // Create report array
do while .t.
@ 10,10 prompt 'Edit form layout'
@ 11,10 prompt 'Edit form columns'
@ 12,10 prompt 'Save report form'
menu to nChoice
do case
case nChoice = 1
dc_frmlayout( aReport, 'CUSTOMER.FRM' ) // edit layout
case nChoice = 2
dc_frmcolumns( aReport, 'CUSTOMER.FRM' ) // edit columns
case nChoice = 3
DC_FRMCREATE( 'CUSTOMER.FRM', aReport ) // save report
exit
endcase
enddo
Source/Library:
_DCRFORM.PRG/.OBJ
See Also:
dc_frmstru
dc_frmlayout()
Edit a report form layout from a report form array
Syntax:
Arguments:
(aReportInfo) is a multi-dimensional array with the report form
information. See DC_FRMSTRU() for a description of this array.
(cFileName) is an optional parameter. This is the name of the
report file which will be created to use as a reference on the
editor screen.
Returns:
A multi-dimensional array containing the modified contents of
the original array.
Description:
DC_FRMLAYOUT() is used to edit the layout of a report form
array. A report form array defines the information in a report
form file (.FRM) file.
Examples:
aReport := dc_frmstru( 'CUSTOMER.FRM' ) // Create report array
do while .t.
@ 10,10 prompt 'Edit form layout'
@ 11,10 prompt 'Edit form columns'
@ 12,10 prompt 'Save report form'
menu to nChoice
do case
case nChoice = 1
DC_FRMLAYOUT( aReport, 'CUSTOMER.FRM' ) // edit layout
case nChoice = 2
dc_frmcolumns( aReport, 'CUSTOMER.FRM' ) // edit columns
case nChoice = 3
dc_frmcreate( 'CUSTOMER.FRM', aReport ) // save report
exit
endcase
enddo
Source/Library:
_DCRFORM.PRG/.OBJ
dc_frmmodify()
Edit or Create a Report form file
Syntax:
Arguments:
(cReportFile) is the name of the Report Form (.FRM) file to
edit. If no argument is given, then the menu will provide a
user-prompt for entering a file name.
Returns:
NIL
Description:
DC_FRMMODIFY() is a complete report form (.FRM) editor.
Examples:
@ 12,10 prompt "Modify a Report Form"
@ 13,10 prompt "Output a Report Form"
menu to nChoice
do case
case nChoice = 1
DC_FRMMODIFY()
case nChoice = 2
dc_frmout()
endcase
Source/Library:
_DCRFORM.PRG/.OBJ
dc_frmout()
Output a report form to screen, printer or file
Syntax:
Arguments:
(cFormFile) is the name of the report form file (.FRM) to
output to the screen, file or printer. If no argument is
given, then the name of the last report form to be printed will
appear in the display for the user to modify.
Description:
DC_FRMOUT() is used output a report form (.FRM) file to the
screen, printer, or a file.
This is a high-level function that prompts the user for
information about how to format the output and scoping
conditions.
Examples:
@ 12,10 prompt "Modify a Report Form"
@ 13,10 prompt "Output a Report Form"
menu to nChoice
do case
case nChoice = 1
dc_frmmodify()
case nChoice = 2
DC_FRMOUT()
endcase
Source/Library:
_DCRFORM.PRG/.OBJ
dc_frmreport()
Front-End to Clipper's report function - displays Odometer
Syntax:
Arguments:
Arguments are the same as __ReportForm(). See STD.CH - REPORT
FORM command.
(cFormFile) - Report form file name
(lPrint) - Output to Printer
(cToFile) - Output to a file (cToFile)
(lNoConsole) - Don't display output on console
(bFor) - FOR condition code block
(bWhile) - WHILE condition code block
(nNext) - Number of records to print
(nRec) - A single record number to print
(lRest) - Print only from current record to the end
(lNoEject) - Don't eject the printer paper first
(lSummery) - Print a summary report
Description:
DC_FRMREPORT() is a front-end to the Clipper __ReportForm()
function. DC_FRMREPORT() can be used as a direct replacement
for the __ReportForm() function that is called when the REPORT
FORM command is pre-processed at compile time.
DC_FRMREPORT() displays a progress odometer during the output
of report to the printer while displaying the actual number of
records already printed. DC_FRMREPORT() also allows the
printed output to be terminated with the ESCape key.
Examples:
// Pre-process REPORT FORM command to call DC_FRMREPORT()
#include "DCRFORM.CH"
REPORT FORM CUSTOMER TO PRINT NOEJECT
Source/Library:
_DCRFORM.PRG/.OBJ, DCLIP.LIB, DCRFORM.CH
dc_frmstru()
Create a report form array from a .FRM form file
Syntax:
Arguments:
(cReportFile) is the name of a report form (.FRM) file.
Returns:
A multi-dimensional array of two sub-arrays:
The first sub-array (1) defines general information about the
entire report.
Element Type Description
------- ---------- -----------------------------------
[1,1] Character Report Heading
[1,2] Character Group Expression
[1,3] Character Sub-Group Expression
[1,4] Character Group Heading
[1,5] Character Sub-Group Heading
[1,6] Numeric Page Width
[1,7] Numeric Lines per Page
[1,8] Numeric Left Margin
[1,9] Numeric Right Margin
[1,10] Numeric Number of Columns
[1,11] Character Double-Spaced? (Y/N)
[1,12] Character Summary Report? (Y/N)
[1,13] Character Page Eject? (Y/N)
[1,14] Character Page Eject Before? (Y/N)
[1,15] Character Page Eject After? (Y/N)
[1,16] Character Plain Page? (Y/N)
The second sub-array (2) consists of a sub-array for each
column (col). A maximum of 24 columns are allowed.
Element Type Description
-------- ---------- ------------------------------
[2,col,1] Numeric Column Width
[2,col,2] Character Totals? (Y/N)
[2,col,3] Numeric Decimals
[2,col,4] Character Column expression
[2,col,5] Character Column heading
Description:
DC_FRMSTRU() is used to create a report form multi-dimensional
array from a Report Form (.FRM) file.
Examples:
aReport := DC_FRMSTRU( 'CUSTOMER.FRM' ) // Create report array
aReport := dc_frmlayout( aReport ) // Edit report layout
aReport := dc_frmcolumns( aReport ) // Edit report columns
dc_frmcreate( 'CUSTOMER.FRM', aReport ) // Create report file
Source/Library:
_DCRFORM.PRG/.OBJ
See Also:
dc_frmcreate
dc_gatemenu()
Pop-up a user-configurable menu to gateway to dos programs
Syntax:
Arguments:
(cHeading) is the heading to display at the top of the menu.
If no argument is given, then " Gateway Menu " is default.
(cMenuSel) is a single character designating the program to
run: A,B,C,E,F,G,I,J,K,L,N,O,P,R,T,U,V,W,X,Y,Z,1,2 or 3
If (cMenuSel) argument is not passed, the user is given a
friendly menu in which to select the desired program or to
configure his/her own gateway system for up to 24 different
programs.
cDirectory is the directory that you wish to create the
.DBF file if it doesn't exist. (Default is SET DEFAULT).
cFileName (new) - The name you want to assign to the .DBF
if it doesn't exist. (Default is DCGATE.DBF)
Description:
DC_GATEMENU() will pop-up a menu of user-defined DOS programs
to run or run a specified user-defined program by letter
reference.
Notes:
The DCGATE.DBF files stores the information about the COMMAND,
DIRECTORY, MEMORY NEEDED, SWAP DRIVE, etc. to allow quick
access to other DOS programs.
All the instructions for configuring the gateway are in the
pop-up menu.
FILES REQUIRED:
DCGATE.DBF must reside in current path or in the SET DCLIP
directory.
Examples:
DC_GATEMENU() // display menu of pre-defined programs.
DC_GATEMENU( 'C' ) // run program number C.
Source/Library:
_DCGATE2.PRG/.OBJ, DCLIP.LIB
See Also:
GATE
dc_gateway()
Call the dos shell or any other executable program
Syntax:
Arguments:
(cCommand) is a string containing the NAME OF THE PROGRAM to
run and it's parameters. If it is an empty string, the
function will shell out to dos and run COMMAND.COM.
(nMemory) is the AMOUNT OF MEMORY in K that you want to free
up. Specify 0 or a number greater than available memory to free
up all the memory possible.
(cPrompt) is a string containing the DOS PROMPT you want
displayed if you are shelling to dos.
(cSwapDir) is a string containing one or two DOS path
specifications (seperated by semi-colon) to tell DC_GATEWAY()
where to place the temporary file(s) produced by DC_GATEWAY().
(cEnvironment) is a set of environment strings (separated by
CHR(0)s) to modify the parent environment. This can be used to
add, delete, or change any environment string in the parent
environment.
Returns:
A Logical .TRUE. if the function succeeded or .FALSE. if the
function call produced an error. See GATEWAY ERROR for possible
error codes.
Description:
DC_GATEWAY() will release memory from dCLIP or your application
for running other large DOS programs, save the memory image to
a temporary file, run the desired program, then restore the
memory image and return to the calling program.
Source/Library:
_DCGATE1.PRG/.OBJ, DCLIP.LIB
See Also:
DOS
dc_getactive()
Return the currently active GET object
Syntax:
Arguments:
NONE
Returns:
DC_GETACTIVE() returns the current active Get object within the
current READ by DC_READMODAL(). If there is no READ active when
DC_GETACTIVE() is called, it returns NIL.
Description:
DC_GETACTIVE() is an environment function that provides access
to the active GET object during a READ. The current active Get
object is the one with input focus at the time DC_GETACTIVE() is
called.
Notes:
DC_GETACTIVE() works with DC_READMODAL() in the same way that
Clipper's GETACTIVE() works with READMODAL().
Examples:
// This code uses a WHEN clause to force control to branch to a
// special reader function. Within this function, DC_GETACTIVE()
// retrieves the active Get object:
GetList := {}
@ 10, 10 GET x
@ 11, 10 GET y WHEN MyReader()
@ 12, 10 GET z
dc_readmodal( GetList )
// Called just before second get (above)
// becomes current
FUNCTION MyReader
LOCAL objGet // Active Get holder
objGet := DC_GETACTIVE() // Retrieve current
// active Get
BarCodeRead( objGet )
RETURN (.F.) // Causes Get to be
// skipped in READ
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_getclip()
Get the value of a Clipper Environment setting
Syntax:
Arguments:
(cName) is any parameter that has been burned into the
Clipper .EXEcutable or has been passed via the // option.
Returns:
A numeric value.
Description:
DC_GETCLIP() will retrieve environment variables that have
been passed to the Clipper application via the // command-
line option, have been included in the SET CLIPPER=(envir)
command or have been burned into the application with the
linker.
Examples:
// Assume that the application is MAIN.EXE
MAIN //X120;F99;MOUSE;RDD:2
? DC_GETCLIP("X")
120
? DC_GETCLIP("F")
99
? DC_GETCLIP("MOUSE")
0
? DC_GETCLIP("RDD")
2
? DC_GETCLIP("ROGER") // not defined
-1
Source/Library:
GETCLIP.ASM,.OBJ, DCLIP.LIB
dc_getdevout()
A Replacement for DevPos()/DevOut() when writing @SAY..GETS
Syntax:
Arguments:
(nRow) is the display row.
(nCol) is the display column.
(cExpr) is the string to display.
(cColor) is the display color for the string. If no argument
is passed, the current system color will be used.
Returns:
Nil
Description:
DC_GETDEVOUT() is used in @SAY..GET translations contained
in DCGET.CH in place of DevPos() and DevOut(). This
function will not display the prompt on the screen if it
has been positioned outside the scroll-region coordinates
pre-set by DC_READBOX() or DC_READWINDOW() and will set
appropriate static flags for DC_READMODAL() to allow for
scrolling the prompt in the GET window area.
Notes:
DC_READWINDOW() or DC_READBOX() must be called before
displaying any SAYS with the @SAY..GET command or with
DC_GETDEVOUT().
Examples:
#include "dcget.ch"
LOCAL GetList := {}, aData, i
use (cDataFile)
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)
DC_GETDEVOUT( i, 12, PadL(Field(i),10), )
SetPos( Row(), Col()+1 )
AAdd( GetList,_GET_(aData[i],"aData[i]",,,) )
DC_GetDisplay( GetList )
GetList := DC_AddCargo(GetList,-1*i)
GetList := ;
DC_AddCargo(GetList,{ 108, { i, 12, PadL(Field(i),10) }})
NEXT
DC_ReadModal( GetList,,aReadArea )
RETURN nil
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readbox()
dc_getdisplay()
Display a GET on the screen if it falls in scroll region
Syntax:
Arguments:
(GetList) is the GET array containing a set of GETS.
Returns:
Nil
Description:
DC_GETDISPLAY() is used in @SAY..GET translations contained
in DCGET.CH in place of the default display method. This
function will not display the GET on the screen if it
has been positioned outside the scroll-region coordinates
pre-set by DC_READBOX() or DC_READWINDOW() and will set
appropriate static flags for DC_READMODAL() to allow for
scrolling the GET in the pre-established window area.
Notes:
DC_READWINDOW() or DC_READBOX() must be called before
displaying any GETS with the @SAY..GET command or with
DC_GETDISPLAY().
Examples:
#include "dcget.ch"
LOCAL GetList := {}, aData, i
use (cDataFile)
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)
DC_GetDevOut( i, 12, PadL(Field(i),10), )
SetPos( Row(), Col()+1 )
AAdd( GetList,_GET_(aData[i],"aData[i]",,,) )
DC_GETDISPLAY( GetList )
GetList := DC_AddCargo(GetList,-1*i)
GetList := ;
DC_AddCargo(GetList,{ 108, { i, 12, PadL(Field(i),10) }})
NEXT
DC_ReadModal( GetList,,aReadArea )
RETURN nil
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_readbox()
dc_getvalue()
Handy function for getting an input value from user
Syntax:
Arguments:
(cType) is the type of value to prompt the operator for.
"C" - Character
"N" - Numeric
"L" - Logical
"D" - Date
"M" - Memo
(cPrompt) is the operator prompt. If no argument is given then
"Enter a Character, Number, Date, Yes or No, or Text" is
default.
Returns:
A Date value if (cType) is "D".
A Character string if (cType) is "C" or "M".
A Logical .T. or .F. if (cType) is "L".
A Number if (cType) is "N".
Description:
DC_GETVALUE() is a function that simply prompts the operator to
enter a value to be used for any purpose. This function is
handy when a user input prompt is needed in a code block or
macro to get a value from the operator.
Examples:
-- Example 1 -
The database browsing function, DC_BROWSEDB(), supports a
feature called "replacement by macro" which allows the user to
create a special macro for replacing data in the currently
selected browse column. DC_GETVALUE() is a handy function that
can be imbedded in a macro code block for getting a value from
the operator before completing the replacement.
Macro Expression: EVAL( {||X := GETVALUE('D'), X + 30 } )
In the above example pressing the macro key will prompt the
user to enter a date, add 30 days to the date, then replace the
current field with the final value.
Source/Library:
_DCGET.PRG/.OBJ, DCLIP.LIB
dc_gobottom()
Go to the bottom record of a "scoped" database
Syntax:
Arguments:
(xBottom) is a value that matches the same type as the index
key to set as the bottom of the database.
Returns:
nil
Description:
DC_GOBOTTOM() is used to go to the bottom record 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:
use customer index custname
DC_GOBOTTOM('L')
? cust_name
Lionel Gooseberry
Source/Library:
_DCAREA2.PRG/.OBJ, DCLIP.LIB
dc_gotoget()
Go directly to a desired GET
Syntax:
Arguments:
none.
Returns:
NIL
Description:
DC_GOTOGET() is handy if you have a large table of GETS on the
screen and don't have a mouse, but want to give the operator
an opportunity to go directly to a GET # by typing in the GET
number.
Notes:
This function only works with DC_ReadModal(), NOT ReadModal().
Examples:
SetKey( -1, { || DC_GOTOGET() } )
DC_ReadModal( GetList )
Source/Library:
_DCGETSY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_readmodal()
dc_gotop()
Go to the top record 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.
Returns:
nil
Description:
DC_GOTOP() is used to go to the top record 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:
use customer index custname
DC_GOTOP('C')
? cust_name
Charlie Weaver
Source/Library:
_DCAREA2.PRG/.OBJ, DCLIP.LIB
dc_handinit()
Initialize the file handle to name function
Syntax:
Arguments:
(nMode) is a numeric value. A value of 1 is used to
initialize the handle function and set the DOS interrupt.
A value of 0 will disable the handle function and unload
the interrupt. The interrupt is automatically unloaded when
the application is quit to dos.
Returns:
nil
Description:
DC_HANDINIT() is used to initialize the routine that returns
the file name from a DOS handle. After DC_HANDINIT(1) is
called, all files opened by FOPEN(), FCREATE(), dbUseArea(),
and any other Clipper function that opens files will be placed
in an array to be retrieved by the DC_HANDNAME() function.
Examples:
// initialize the file name grabbing system
DC_HANDINIT(1)
set defa to \myapps
use customer
nHandle := dc_dbfhandle()
? dc_handname( nHandle )
\MYAPPS\CUSTOMER.DBF
Source/Library:
HNDNAME.ASM/.OBJ, DCLIP.LIB
See Also:
dc_handname()
dc_handname()
Return a DOS file name from the file handle
Syntax:
Arguments:
(nHandle) is a DOS handle that is returned by FOPEN(),
FCREATE() or any other Clipper file-opening mechanism such as
dbUseArea(), dbSetIndex(), etc.
Returns:
A character string with the name of the file associated with the
file handle. If no file is open under the specified file handle
a null "" string is returned.
Description:
DC_HANDNAME() is used to get the name of a file from the DOS
handle.
DC_HANDINIT() must be called first to enable DC_HANDNAME().
Examples:
// initialize the file name grabbing system
dc_handinit()
set defa to \myapps
use customer
nHandle := dc_dbfhandle()
? DC_HANDNAME( nHandle )
\MYAPPS\CUSTOMER.DBF
Source/Library:
HNDNAME.ASM/.OBJ, DCLIP.LIB
See Also:
dc_handinit()
dc_hasmemo()
Does the current database contain a memo field?
Syntax:
Arguments:
(nArea) is the database work area. If no argument is given,
then the currently selected work area is used.
Description:
DC_HASMEMO() reports whether or not a memo field exists in a
work area.
Examples:
. use baseball
. ? DC_HASMEMO()
.F.
. use dctutor
. ? DC_HASMEMO()
.T.
Source/Library:
_DCAREA.PRG/.OBJ, DCLIP.LIB
dc_help()
A General help and context-specific help system
Syntax:
Arguments:
(cCommand) is the name of the command or function to display.
If no parameter is passed, then the help maintenance menu
will be displayed, otherwise the COMMAND field in the help
database is searched for the passed command and the help
information for the first matching command or function will
be displayed.
(lMemoOnly) if .TRUE. will display only the concatenated
contents of the memo fields. If .FALSE. (default), then the
SYNTAX will also be displayed.
(lSyntax) if .TRUE. will display the "syntax builder" for
the specified command or function which allows the user to
fill-in the blanks for all the possible arguments used with
the specified command. After filling in the arguments, the
complete function or command (and it's arguments) are
returned. If (lSyntax) is .FALSE., then a null string is
returned.
Returns:
A character string.
Description:
DC_HELP() is used to display, print or maintain the
DCHELP.DBF/.DBT database that contains the text for the
complete dCLIP help system.
The dCLIP help system manages help records that can be used
for creating an on-line reference for a Clipper application
or context-specific help screens.
The help system also includes a sub-menu option to write
the contents of the DCHELP.DBF/.DBT database to *.TXT files
for compiling with the Norton Guide or Expert Help compiler.
A file named DCLIPNG.LNK will also be created for linking
the compiled objects.
THE HELP MAINTENANCE SYSTEM
The standard help maintenance system is invoked by calling
the function DC_HELP() or using the command HELP at the dot-
prompt. All records in the help database are displayed in a
browse-style window and are sorted by 1 of 4 sorting options
selectable by the user.
ADDING OR EDITING A HELP RECORD
To append a new record to the help database select (A) from
the EDIT pull-down menu. To edit a record, first find the
desired record with the SEARCH options or the navigation keys,
then press (E) from the EDIT pull-down menu.
CATEGORY
Enter a category for this help screen. This category will be
used later for sorting and for creating a cross-reference for
Norton Guides.
FUNCTION
Enter an abbreviated description of the function of this help
screen. If you are documenting a COMMAND, then this would be
the command name. If you are documenting a library FUNCTION
then this would be the function name. If you are documenting
general help for a manual, then this would be a short title
for your Norton Guides.
TYPE
Enter the type of help for this record. For example, if you
are documenting a function, enter FUNCTION, or if you are
documenting a command, enter COMMAND.
SHORT DESC
Enter a short description of this help record.
SYNTAX
Enter the syntax for this help record. This field usually
applies only to COMMANDS or FUNCTIONS.
ARGUMENTS
This is a memo field which is to be used for documenting the
arguments that are passed to COMMANDS or FUNCTIONS.
DESCRIPTION
This is a memo field which is used to basically describe the
command, function or any other long description for the help
record.
NOTES
This is a memo field which is used to document any special
notes relating to the use of the function or command.
EXAMPLES
This is a memo field which is used to document how to use a
command or function.
RETURNS
This is a memo field which is used to document the value
returned by functions.
FILES
Enter the name of any files which pertain to this command or
function. For example, if you are documenting a function,
enter the name of the source code file and/or library file
that contains the function.
PROCEDURE
This field is used only for context-specific help. This is
the name of a procedure or help code that would be passed to
the DC_HELPF1() function when the F1 key is pressed.
INPUT_VAR
This field is used only for context-specific help. This is
the name of any input variable that would be passed to the
DC_HELPF1() function when the F1 key is pressed.
SCREEN COORDINATES
These fields are used only for context-specific help. These
are the screen-coordinates to use for displaying the
concatenated help memos in a scrollable window by the
DC_HELPF1() function when the F1 key is pressed.
USING THE SYNTAX BUILDER
When the Help system is called from the dCLIP dot-prompt or
when the (lSyntax) parameter is passed as a .TRUE. or when
BUILD pull-down menu is used to select a "paste" operation,
a screen will be displayed with each parameter for the user
to fill-in the desired parameters. This aids the user when
building a complex command or function at the dot-prompt and
reduces the probability of arguments being incorrectly
entered. The best way to use this feature from the dot-prompt
is to first enter the key-word for the desired command or
function, then press the (ALT-H) key or click on (ALT-H).
The syntax-builder screen will appear. After filling in the
arguments on the screen simply press F10 and the command or
function will be passed back to the dot-prompt command-line.
Notes:
!name: dCLIP 4.02 Reference Guide
!credits:
(c)1995 DONNAY Software Designs Ý Legend:
P.O. Box 16330 Ý ê - New material in 3.xx
Boise, ID Ý ä - New material in 4.xx
(208) 331-2516, 9am-5pm MST Ý * - Obsolete material
!menu: Overview
Intro / Install INTRO.eho
dCLIP Engine ENGINE.eho
Dot-Prompt INTERP.eho
Application Design DESIGN.eho
Dynamic Linking LINKING.eho
Debugging DEBUG.eho
Libraries LIBRARY.eho
Configuration DCLIPSYS.eho
!menu: Reference
Commands ( A-Q ) COMM1.eho
Commands ( R-Z ) COMM2.eho
Command Categories COMMREF.eho
Functions ( DC_A*() - DC_D*() ) FUNC1.eho
Functions ( DC_E*() - DC_K*() ) FUNC2.eho
Functions ( DC_L*() - DC_Q*() ) FUNC3.eho
Functions ( DC_R*() - DC_Z*() ) FUNC4.eho
Function Categories FUNCREF.eho
!menu: System
Tutorial TUTOR.eho
Environment ENVIR.eho
Color System COLOR.eho
Printer Driver PRINTER.eho
Query Builder QUERY.eho
User System USER.eho
Error System ERRORS.eho
ClipScan CLIPSCAN.eho
!menu: Design
File Group Editor FILE_ED.eho
Field Group Editor FIELD_ED.eho
Menu Editor MENU_ED.eho
Key Editor KEY_ED.eho
Data-Entry Editor EDIT_ED.eho
Browse Editor BROW_ED.eho
Screen Editor SCRN_ED.eho
Other Editors OTHER_ED.eho
!menu: DBMS
Assistant ASSIST.eho
Data Browsing BROWSE.eho
Data Editing EDIT.eho
Rdd Compatability RDD.eho
Work System WORK.eho
Utilities UTIL.eho
Report Manager REPMGR.eho
Report Editor REPEDIT.eho
Examples:
// Display help database pick-list and menu
DC_HELP()
// Display help information about DC_DBCHOICE()
DC_HELP( 'DC_DBCHOICE' )
Source/Library:
_DCHELP.PRG/.OBJ, DCLIP.LIB
dc_helpblock()
Post a code block to establish the Help system to call with F1
Syntax:
Arguments:
(bBlock) is a code block to evaluate. The Procedure Name,
Line Number, and Input Variable Name will be passed to the
code block when F1 is pressed.
Returns:
A Code Block.
Description:
DC_HELPBLOCK() is used to insure that dCLIP's HELP SYSTEM doesn't
override any existing help system mapped by SET KEY F1 TO
(help proc).
Rather than changing lots of code, it was simpler and more stable
to add a new function to insure that any calls to DC_HELPF1() get
re-routed to any other help system. Use DC_HELPBLOCK( (bHelp) )
to point to the help system function to call.
If you have problems with the dCLIP help system conflicting with
your help system, add the following line of code at the start of
your program:
DC_HELPBLOCK( {|a,b,c|HELP(a,b,c)} )
Source/Library:
_DCHELP.PRG, DCLIP.LIB
dc_helpcode()
Post a Help Code for the context-help F1 key
Syntax:
Arguments:
(cHelpCode) is a character string of up to 15 characters.
Pass a NIL value to disable the help code.
Returns:
A character string containing the last HELP CODE value.
Description:
DC_HELPCODE() is used to post a system-wide HELP CODE for
establishing context-specific help. This help code will be
used by the dCLIP context-help function DC_HelpF1() if the
DC_HelpF1() function has been established as the context-help
function to call with the F1 key. When the F1 key is pressed,
the DC_HelpF1() function is passed a PROCEDURE NAME, LINE
NUMBER, and INPUT VAR. If no help is found that matches the
PROCEDURE NAME + INPUT VAR or the PROCEDURE NAME, then the
HELP CODE will be used to display the help screen.
Examples:
/* Display default BROWSE system help screen if F1 pressed */
DC_HELPCODE( 'BROWSE' ) // display
Source/Library:
_DCHELP.PRG/.OBJ, DCLIP.LIB
See Also:
dc_helpf1()
dc_helpf1()
A context-specific help system
Syntax:
Arguments:
(cProcName) is a character string of up to 15 characters
which will be used to search for the help screen.
(nLineNmbr) is a numeric parameter that is required for
compatability with the standard SET KEY command. This
parameter is not used therefore it may be passed as any
value type including a NIL.
(cInputVar) is the name of the pending input variable. If
this parameter is passed, then the concatenated values in
(cProcName) + (cInputVar) will be used to search for the
help screen, otherwise only the value in (cProcName) will
be used.
Returns:
Nil.
Description:
DC_HELPF1() is used to display a context-specific help screen
that has been previously stored in the DCHELP.DBF database.
Context help screens are those in which a value has been
entered in the PROC_NAME and/or INPUT_VAR fields of the DCHELP
database. When the F1 key is pressed, thereby calling the
DC_HELPF1() function, a procedure name and/or input var value
is passed to the function to determine the help screen in the
database to display.
The DCHELP.DBF database is indexed on PROC_NAME+INPUT_VAR and
the index is searched by SEEKing the (cProcName) + (cInputVar)
values passed to the function. If a match is found, the
help screen will be displayed. If a match is not found, then
the index is searched again only for the (cProcName) value.
If a match is still not found, then the index is searched again
for a match to any HELP CODE value posted with the DC_HelpCode()
function. If still no match is found, then the user is given
the option of creating a new help record on-the-fly or selecting
from a pick-list of existing help records and matching the
passed parameters to the chosen help record by storing them in
the respective fields.
Each help record consists of a category, type, short description,
and several memo fields which are all concatenated together when
the help screen information is displayed. In addition, each
help record contains screen coordinates which determine the size
and location of the help window that is displayed.
It is also recommended that you set K_ALT_F1 to call the
DC_HELPF1() function. The function tests to see if it was called
by F1 or ALT-F1 and if the ALT-F1 key was pressed it defaults
to "Edit" mode and allows you to modify existing help screens.
Examples:
-- Example 1 --
/* Display default BROWSE system help screen if F1 pressed */
DC_HELPCODE( 'BROWSE' ) // display
-- Example 2 --
DC_SetKeys( { K_F1, K_ALT_F1 }, {|p,l,v|DC_HELPF1(p,l,v)} )
Source/Library:
_DCHELP.PRG/.OBJ, DCLIP.LIB
See Also:
dc_help()
dc_helpfile()
Establish the file and alias name for the Help Database
Syntax:
Arguments:
(cHelpFile) is the name that defines the database file to
be used as the Help System Database. The default file name
is DCHELP.DBF and the alias is DCHELP. If the file doesn't
exist it will be created.
(cHelpAlias) is the alias name (up to 7 characters) to use.
If this parameter is not passed, then the alias will be
given the same name as (cHelpFile). The help system creates
four (4) index files with the names (cHelpAlias)1 thru
(cHelpAlias)4, therefore (cHelpAlias) cannot be longer than
7 characters.
Returns:
Nil
Description:
DC_HELPFILE() is used to define the name of the file to use
as the Help System Database. If the file does not already
exist it will be created. The default name of the Help
Database is DCHELP.DBF.
Notes:
DC_KEYLOAD() in dCLIP version 4.0 and later works slightly
different than previous versions. In earlier versions, there
was only one Key Group for the 40 "Function Keys", ie F1 thru
Alt-F10. The first parameter passed to DC_KEYLOAD() in previous
versions was the Key file name. Now that DC_KEYLOAD() supports
so many new features, it has been designed for use with Key
Groups. To post a file name to use other than the DCKEY.DBF
default database, use this DC_KEYFILE() function.
Examples:
DC_HELPFILE( "C:\MYDATA\MYHELP.DBF" )
DC_HELP()
Source/Library:
_DCHELP.PRG/.OBJ, DCLIP.LIB
See Also:
dc_help()
dc_hunt()
Search all open index tags for a match to passed value
Syntax:
Arguments:
(cValue) is the value to find.
(cExpression) is an expression that produces a value to find.
If no (cValue) | (cExpression) argument is passed, then the
user will be prompted to enter a value.
(lResume) if .TRUE. will resume "hunting" for an index starting
from the last index searched. If .FALSE. (default) then the
"hunting" process starts at the first index in the order of
index files or tags.
(DispMsg) if .TRUE. will display a message if record not found
(default). IF .FALSe. will display no message - just leaves
file at EOF.
Returns:
NIL
Description:
DC_HUNT() provides a method of FINDing a record by searching
all open index files or tags for the value entered. This is
the quickest method of finding information by scanning all the
keys for the first match. The character value argument passed
is automatically converted to the proper "type" to perform the
seek. For example, if you entered the argument "12.5",
character and numeric indexes will be seeked, or if you enter
the argument "01/02/03", character and date indexes will be
seeked. If you enter the argument "DATE()-30", then only the
indexes that match the type of the expression entered will be
seeked.
Using DC_HUNT() is the fastest method of finding information in
a large database that uses many index keys. It is recommended
that you build a set of keys for all fields that you want to
include in the DC_HUNT() operation. This can be accomplished
easily by using the INDEX FIELDS command to create a set of
tags all at one time.
Examples:
USE dchelp INDEX dchelp1, dchelp2, dchelp3
DC_HUNT('dc_hunt')
DC_HUNT('BROWSE TILE')
Source/Library:
_DCHUNT.PRG/.OBJ
See Also:
HUNT
dc_ifelse()
Evaluate a list of expressions based on a condition
Syntax:
Arguments:
(bIf) is a code block to be that is evaluated as the IF
statement.
(bDoIf) is a code block that is evaluated if (bIf) evaluates
.TRUE.
(bDoElse) is a code block that is evaluated if (bIf) evaluates
.FALSE.
Returns:
NIL
Description:
DC_IFELSE() is a "function" replacement for IF...ELSE...ENDIF
programming structure to be used when a function is needed,
i.e. for calling via macro, code blocks, etc.
Examples:
local bIf := { || eof() }
local bDoIf := { || x := dc_expl(10,10,12,20), ;
devpos(11,12),;
devout("End of File"),;
inkey(0),;
dc_impl(x) }
local bElseIf := { || _FIELD-)print_flag := .t. }
setkey( -1, { || DC_IFELSE( bIf, bDoIf, bElseIf ) } )
Source/Library:
_DCEVAL.PRG/.OBJ, DCLIP.LIB
dc_impeval()
Return a portion of a field based on passed parameters
Syntax:
Arguments:
(cFieldName) is the name of the import field.
(nStPos) is the character position in the import field to start
extracting from if the (cStDelim) argument is not passed or is
a null ("") argument. If a (cStDelim) argument is passed then
(nStPos) is the character position equal to the nth occurence
of the (cStDelim) in the import field.
(cStDelim) is the starting delimeter.
(nEnPos) is the character position in the import field to stop
extracting from if the (cEnDelim) argument is not passed or is
a null ("") argument. IF a (cEnDelim) argument is passed then
(nEnPos) is the character position equal to the nth occurence
of the (cEnDelim) in the import field.
(cEnDelim) is the ending delimeter.
(cInstr) is an optional string of characters to insert at the
beginning of the replaced data.
(cAppStr) is an optional string of characters to insert at the
end of the replaced data.
Returns:
A character string.
Description:
DC_IMPEVAL() is a function that is used to extract a portion of
a character field based on positional information that is
included in the arguments passed to DC_IMPEVAL().
For example, DC_IMPEVAL() can be used to extract the last name
from a name string, the area code from a telephone number, etc.
Examples:
use customer
? name
Bush, George
cLastName := DC_IMPEVAL('customer-)name',1,,1,',')
? cLastName
Bush
cFirstName := DC_IMPEVAL('customer-)name,1,',',20)
? cFirstName
George
Source/Library:
_DCIMP.PRG/.OBJ, DCLIP.LIB
See Also:
dc_impextract()
dc_impextract()
Build DC_IMPEVAL() expression from a user-friendly menu
Syntax:
Arguments:
(cFieldName) is the name of the import field to extract from.
Returns:
An expression in a character string that is evaluated with the
macro compiler to extract the information from the database field.
Description:
DC_IMPEXTRACT() produces a user-friendly menu to aid in
creating a complex expression that is used to extract
information from a database field. DC_IMPEXTRACT() will build
an expression that uses the DC_IMPEVAL() function. After the
user answers questions about how he/she wishes to extract
information from a field, the data is properly formatted as
parameters which are included in the expression. The
character-string expression created by DC_IMPEXTRACT() is
usually saved in an Import array which is later evaluated used
to extract data from another database.
Examples:
use customer
? phone_num
(714)263-1011
cEval := DC_IMPEXTRACT( 'phone_num' )
? cEval
DC_IMPEVAL("CUSTOMER-)PHONE_NUM",1,"(",1,")","","")
? &(cEval)
714
Source/Library:
_DCIMP.PRG/.OBJ, DCLIP.LIB
See Also:
dc_impmapcreate()
dc_impfields()
Create field mapping array from a pick-list of data fields
Syntax:
Arguments:
(cTargetAlias) is the alias name of the target work area in
which data will be imported TO.
(cImpAlias) is the alias name of the work area in which data
will be imported FROM.
NOTE: (cTargetAlias) and (cImpAlias) may be the same work area
if the information is simply being copied from one field to
another in an a single work area.
Returns:
A multi-dimensional array with 2 parallel sub-arrays. Each
element in sub-array 1 is a character type expression defining the
"target" database field. Each element in sub-array 2 is a character
type expression defining the "import" database field.
Example:
Element Contents
-------- -----------
[1][1] CUSTOMER-)CONTACT
[1][2] CUSTOMER-)CONTACT
[1][3] CUSTOMER-)BILL_STRT
[1][4] CUSTOMER-)BILL_CITY
[1][5] CUSTOMER-)COMMENTS
[2][1] CUST_BOR-)FNAME
[2][2] CUST_BOR-)LNAME
[2][3] CUST_BOR-)ADDRESS1
[2][4] CUST_BOR-)ADDRESS2
[2][5] CUST_BOR-)OCCUPATION
Description:
DC_IMPFIELDS() is used to match fields between 2 work areas and
save the "matches" to an array which is used for "importing"
data from one database to another.
Two (2) field pick-lists and menu options are displayed to aid
in matching field to field. The information is then saved to
an array which can be used with the DC_IMPREPLACE() function to
copy the information from one workarea to another.
Examples:
aImportMap := DC_IMPFIELDS('customer','transact')
do while .t.
@ 10,10 prompt "Select a Customer File record"
@ 11,10 prompt "Select a Transaction File record"
@ 12,10 prompt "Replace Customer Data with Transaction Data"
menu to nChoice
do case
case nChoice = 1
sele customer
dc_dbpick(5,20,20,40,"Cust_name")
case nChoice = 2
sele transact
dc_dbpick(5,10,20,60,"Tran_nmbr","tran_type","tran_date")
case nChoice = 3
dc_impreplace( aImportMap, "customer" )
endcase
enddo
Source/Library:
_DCIMP.PRG/.OBJ, DCLIP.LIB
See Also:
dc_impmapcreate()
dc_impl()
Implode a window created by dc_expl()
Syntax:
Arguments:
(cSaveScreen) is a composite string consisting of the screen
contents, coordinates, colors, etc.
Returns:
NIL
Description:
DC_IMPL() is used to implode a window created by DC_EXPL().
Examples:
cSaveScreen := dc_expl( 10,10,12,70, ' Enter a command ' )
cCommand := SPACE(50)
@ 11,12 get cCommand
read
DC_IMPL( cSaveScreen )
Source/Library:
_DCEXPL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_expl()
dc_implode()
Implode a window created by dc_explode()
Syntax:
Arguments:
(cSaveScreen) is a composite string consisting of the screen
contents, coordinates, colors, etc.
Description:
DC_IMPLODE() is used to implode a window created by
DC_EXPLODE().
Examples:
cSaveScrn := dc_explode(5,10,7,70,'B/W','N/W',.F.,;
' Enter a Command ',10)
cCommand := space(50)
@ 6,12 get cCommand
read
DC_IMPLODE( cSaveScrn )
Source/Library:
_DCEXPL.PRG/.OBJ, DCLIP.LIB
See Also:
dc_explode()
dc_impl()
dc_expl()
dc_explmode()
dc_impmapcreate()
Create a field replacement map (.DCF) file
Syntax:
Arguments:
(cMapFile) is the name of the Import Map file to create. If no
extension is included then .DCF is assumed.
(cTargetAlias) is the ALIAS name of the target database that
data will be imported TO. If no argument is given, then the
currently selected database is the default.
(cImportAlias) is the ALIAS name of the import database that
data will be imported FROM. If no argument is given, then a
user-prompt will appear to enter the name of the database or to
choose an open database from a pick list.
Returns:
A logical .TRUE. if the file is created, .FALSE. otherwise.
Description:
DC_IMPMAPCREATE() is used to create a Field Map file (.DCF). A
Field Map is used to establish the rules for importing data
from a database with a different structure than the target
database.
Two windows will pop-up on the screen with instructions for
matching fields. Fields can be matched even though they are
different names, types and/or lengths. Data from character
string fields can be "extracted" by definition of a condition
for extraction, then imported to different fields or
re-formatted into a single field. For example, data in a field
named NAME can be imported into two fields named LAST_NAME and
FIRST_NAME, or a phone number in the format 999-999-9999 can be
re-formatted in the target file as (999)999-9999.
Import map (.DCF) files can be used with the DC_IMPREPLACE() or
DC_IMPORT() functions for importing transaction files, new
names for mail lists, etc., or they can be loaded into memory
and used with the Browse system for "grabbing" selected records
from a work area and appending them to the current work area.
Examples:
use customer via 'DBFNTX'
sele 0
use cust_bor via 'PDX'
DC_IMPMAPCREATE( 'NEWCUST','CUSTOMER','CUST_BOR' )
Source/Library:
_DCIMP.PRG/.OBJ, DCLIP.LIB
See Also:
dc_import()
IMPORT CREATE
dc_impmapload()
Load an array with a field replacement map
Syntax:
Arguments:
(cMapFile) is the import map (.DCF) file to load.
Returns:
A multi-dimensional array with 2 parallel sub-arrays. Each
element in sub-array 1 is a character type expression defining the
"target" database field. Each element in sub-array 2 is a character
type expression defining the "import" database field.
Example:
Element Contents
-------- -----------
[1][1] CUSTOMER-)CONTACT
[1][2] CUSTOMER-)CONTACT
[1][3] CUSTOMER-)BILL_STRT
[1][4] CUSTOMER-)BILL_CITY
[1][5] CUSTOMER-)COMMENTS
[2][1] CUST_BOR-)FNAME
[2][2] CUST_BOR-)LNAME
[2][3] CUST_BOR-)ADDRESS1
[2][4] CUST_BOR-)ADDRESS2
[2][5] CUST_BOR-)OCCUPATION
Description:
DC_IMPMAPLOAD() is used to load an import map file (.DCF) into
an array for later processing.
Examples:
aImportMap := DC_IMPMAPLOAD('TRANSACT')
do while .t.
@ 10,10 prompt "Select a Customer File record"
@ 11,10 prompt "Select a Transaction File record"
@ 12,10 prompt ;
"Replace Customer Data with Transaction Data"
menu to nChoice
do case
case nChoice = 1
sele customer
dc_dbpick(5,20,20,40,"Cust_name")
case nChoice = 2
sele transact
dc_dbpick( 5, 10, 20, 60, "Tran_nmbr", "tran_type", ;
"tran_date")
case nChoice = 3
dc_impreplace( aImportMap, "customer" )
endcase
enddo
Source/Library:
_DCIMP.PRG/.OBJ, DCLIP.LIB
See Also:
dc_impmapcreate()
dc_import()
dc_impmapread()
Extract a field map array from the Static array
Syntax:
Arguments:
(nArea) is the work area. If no argument is given, then the
currently selected work area is default.
Returns:
A multi-dimensional array with 2 parallel subarrays containing
the mapping information from one work area to another.
Example:
Target database fields sub-array:
Element Type Field
[1][1] C DCUSER-)LAST
[1][2] C DCUSER-)FIRST
[1][3] C DCUSER-)PHONE
Import database fields sub-array:
Element Type Field
[1][1] C CUSTOMER-)LAST_NAME
[1][2] C CUSTOMER-)FIRST_NAME
[1][3] C CUSTOMER-)TELEPHONE
Description:
DC_IMPMAPREAD() is used to read an a previously loaded import
map into an array.
Examples:
use dcusers
use customer new
select dcusers
// store dcusers.dcf map to memory
dc_impmapstore( dc_impmapload( 'DCUSERS.DCF' ) )
// replace current dcusers.dbf record with current
// customer.dbf record
dc_impreplace( DC_IMPMAPREAD() )
Source/Library:
_DCIMP.PRG/.OBJ, DCLIP.LIB
See Also:
dc_impmapstore()
dc_impmapstore()
Store a field map array to the Static array
Syntax:
Arguments:
(aFieldMap) is a multi-dimensional array with 2 parallel
subarrays containing the mapping information from one work
area to another.
Example:
Target database fields sub-array:
Element Type Field
[1][1] C DCUSER-)LAST
[1][2] C DCUSER-)FIRST
[1][3] C DCUSER-)PHONE
Import database fields sub-array:
Element Type Field
[1][1] C CUSTOMER-)LAST_NAME
[1][2] C CUSTOMER-)FIRST_NAME
[1][3] C CUSTOMER-)TELEPHONE
(nArea) is the work area. If no argument is given, then the
currently selected work area is default.
Returns:
A .TRUE. if a valid array is passed, .FALSE. otherwise.
Description:
DC_IMPMAPSTORE() is used to store and import map array to the
system static array.
Examples:
use dcusers
use customer new
select dcusers
// store dcusers.dcf map to memory
DC_IMPMAPSTORE( dc_impmapload( 'DCUSERS.DCF' ) )
// replace current dcusers.dbf record with current
// customer.dbf record
dc_impreplace( dc_impmapread() )
Source/Library:
_DCIMP.PRG/.OBJ, DCLIP.LIB
See Also:
dc_import()
IMPORT
dc_impmapread()
dc_import()
Import a data file of any structure by matching fields
Syntax:
Arguments:
(cImpAlias) is the ALIAS name of the database to import FROM.
If no argument is given, then the user will be prompted for the
name of the database.
(cFieldMap) is the name of the Import Map file (.DCF) to use.
If no argument is given, then the user will be given a set of
field pick lists to match fields from the import database to
the target database.
(bFor) is a code-block that defines the condition for the
import file records to be appended. If no argument is passed,
then all records in the import database will be appended.
(bWhile) is a code-block that is evaluated after each record
and terminates the importing of records when it evaluates
.FALSE.
(nNext) is an optional number that defines how many records to
process starting with the current record.
(nRecord) is an optional record number to process.
(lRest) is an optional logical value that determines whether
the scope of the import is all records, or starting with the
current record and proceeding to the end of the file.
Returns:
A logical .TRUE. if data is successfully imported, .FALSE.
otherwise.
Description:
DC_IMPORT() will transfer records from any data file supported
by the RDD's included in dCLIP to the currently selected data
file.
DC_IMPORT() will allow transfer of data between data files with
different structures. Data from fields of different TYPES can
be transferred with DC_IMPORT().
A map file (.DCF) can be specified for determining how the data
fields from the import database will be mapped to the target
(currently selected) database.
DC_IMPORT() supports "extracting" and "formatting" of
information that is being imported. For example, a phone
number in the format 999-999-9999 can be imported to the target
field in the format (999)999-9999.
Examples:
-- Example 1 --
use customer
DC_IMPORT() // user-prompt menu for importing to customer.dbf
-- Example 2 --
// import from TRANSACT.DBF using CUSTTRAN.DCF map file for
// all records transacted today
DC_IMPORT( 'transact','custtran.dcf',{||ship_date=date()} )
Source/Library:
_DCIMP.PRG/.OBJ, DCLIP.LIB
See Also:
IMPORT FROM
dc_fmapimport()
dc_impreplace()
Replace field data with data record of different type
Syntax:
Arguments:
(aMap) is a multi-dimensional array with 2 parallel sub-arrays.
Each element in sub-array 1 is a character type expression
defining the "target" database field. Each element in
sub-array 2 is a character type expression defining the
"import" database field.
Example:
Element Contents
-------- -----------
[1][1] CUSTOMER-)CONTACT
[1][2] CUSTOMER-)CONTACT
[1][3] CUSTOMER-)BILL_STRT
[1][4] CUSTOMER-)BILL_CITY
[1][5] CUSTOMER-)COMMENTS
[2][1] CUST_BOR-)FNAME
[2][2] CUST_BOR-)LNAME
[2][3] CUST_BOR-)ADDRESS1
[2][4] CUST_BOR-)ADDRESS2
[2][5] CUST_BOR-)OCCUPATION
(cTargetAlias) is the alias name of the target database. This
argument is not needed if the Target database is selected
first.
(lAppend) if .TRUE. will APPEND the information in the import
fields to the existing information in the target fields for
target fields of type "C" or "M". If .FALSE., the data in the
target fields will be REPLACED by the data in the import
fields.
Returns:
NIL
Description:
DC_IMPREPLACE() will replace or append information in the
"target" database with information in the "import" database
based on the "mapping" information contained in a
multi-dimensional array. The multi-dimensional array
information may be loaded from a (.DCF) field-map file with
DC_IMPMAPLOAD().
Examples:
aImportMap := dc_impmapload('TRANSACT')
do while .t.
@ 10,10 prompt "Select a Customer File record"
@ 11,10 prompt "Select a Transaction File record"
@ 12,10 prompt "Replace Customer Data with Transaction Data"
menu to nChoice
do case
case nChoice = 1
sele customer
dbpick(5,20,20,40,"Cust_name")
case nChoice = 2
sele transact
dbpick(5,10,20,60,"Tran_nmbr","tran_type","tran_date")
case nChoice = 3
DC_IMPREPLACE( aImportMap, "customer" )
endcase
enddo
Source/Library:
_DCIMP.PRG/.OBJ, DCLIP.LIB
See Also:
dc_import()
IMPORT
dc_impeval()
dc_fmapimport()
dc_index()
A pop-up expression builder for creating index keys
Syntax:
Arguments:
(cOldKey) is the value of the current index key. Pass the old
key value if you wish to add to the key. Pass no arguments if
you wish to create a new key.
Description:
DC_INDEX() is an index-builder utility that allows the user to
create an index expression from pop-up field lists.
Examples:
cls
setkey( -1, {||x:=DC_INDEX(),__keyboard(x)} )
cKey := space(40)
@ 10,10 say 'Press key F2 for Index builder'
@ 12,10 say 'Enter Index key' GET cKey
read
setkey( -1 )
Source/Library:
_DCINDEX.PRG/.OBJ, DCLIP.LIB
dc_indexcount()
Return the number of indexes open
Syntax:
Arguments:
(nArea) is the work area. If no argument is given then the
current work area is used.
Description:
DC_INDEXCOUNT() returns the total number of index files open.
Examples:
select 1
use customer index custname, custnmbr
select 2
use invoice
select 3
use invitems index invitems
? DC_INDEXCOUNT(1)
2
? DC_INDEXCOUNT(2)
0
? DC_INDEXCOUNT(3)
1
Source/Library:
_DCAREA.PRG/.OBJ, DCLIP.LIB
See Also:
dc_taginfo()
dc_indexfilt()
Return the Conditional Index Expression
Syntax:
Arguments:
(nOrder) is the index order. If no argument is given, then the
currently selected order is used.
Returns:
A character string.
Description:
DC_INDEXFILT() returns the filter condition (if any) used in an
open index.
Examples:
. use sales via 'DBFNTX' // Use Conditional Index driver
. index on year for sales ) 100000
. ? DC_INDEXFILT()
sales ) 100000
. select 2
. use customer via 'DBFSIX'
. index on cust_nmbr tag users of customer for cust_code = 'U'
. ? DC_INDEXFILT()
cust_code = 'U'
Source/Library:
_DCAREA2.PRG/.OBJ, DCLIP.LIB
See Also:
dc_taginfo()
dc_indexkey()
Return the current index key expression
Syntax:
Arguments:
None
Returns:
A Character string containing the current index key value.
If no index is in use or a data driver is being used that
does not support indexes, then a null "" string is returned.
Description:
DC_INDEXKEY() is used as a replacement for Clipper's
INDEXKEY() function to prevent runtime errors when using
a database driver that does not suport indexes.
Examples:
use sales
index on year+month to sales
? DC_INDEXKEY()
year+month
Source/Library:
_DCAREA2.PRG/.OBJ, DCLIP.LIB
dc_indexlist()
Return an array of indexes that match open database
Syntax:
Arguments:
None
Returns:
A multidimensional array. Element 1 of each subarray contains
the file name. Element 2 of each subarray contains the index
key.
Description:
DC_INDEXLIST() will open every index in the current SET DEFAULT
directory, match it's contents against the currently selected
workarea and include the index name and index key in an array
if it can be used with the current work area.
Examples:
// open all indexes that match dchelp.dbf
use dchelp
aIndex := DC_INDEXLIST()
dbClearIndex
for i := 1 to len(aIndex)
dbSetIndex( aIndex[i,1] )
next
Source/Library:
_DCUSE.PRG/.OBJ, DCLIP.LIB
dc_indexname()
Return the full file name of the current index
Syntax:
Arguments:
(nArea) is the work area. If no argument is given, then the
current selected work area is default.
(nOrder) is the order number of the index file. If no argument
is given, then the currently selected index is default.
Returns:
A character string.
Description:
DC_INDEXNAME() returns the full dos file name of an open index.
Examples:
. set rdd to DBFNTX
. select 2
. use C:\DCLIP3\DCPRINT index C:\DCLIP3\DCPRINT
. select 4
. set rdd to DBFSIX
. use F:\CUST\INVOICE index F:\CUST\INV1, F:\CUST\INV2.CDX
. ? DC_INDEXNAME(2)
C:\DCLIP3\DCPRINT.NTX
. ? DC_INDEXNAME(4,1)
F:\CUST\INV1.CDX
. ? DC_INDEXNAME(4,2)
F:\CUST\INV2.IDX
Source/Library:
_DCAREA.PRG/.OBJ, DCLIP.LIB
See Also:
dc_tablename()
dc_indexrestore()
Restore all index files from array created by dc_indexsave()
Syntax:
Arguments:
(aIndexNames) is an array of index file names that was returned
by DC_INDEXSAVE().
Description:
DC_INDEXRESTORE() is used to reopen all index files that were
saved by DC_INDEXSAVE().
Notes:
DC_INDEXRESTORE() will open all indexes listed in the array
without first closing any existing index files. To completely
restore the old index environment use DBCLEARINDEX() first.
Examples:
use customer index custname, custnmbr, custcode
aIndex := dc_indexsave()
set index to
index on balance to balance
dc_browsedb()
dbclearindex()
DC_INDEXRESTORE( aIndex )
Source/Library:
_DCDBIND.PRG/.OBJ, DCLIP.LIB
See Also:
dc_indexsave()
dc_indexsave()
Save the name(s) and order of all open indexes
Syntax:
Arguments:
NONE
Returns:
An array with the file names of each open index.
Description:
DC_INDEXSAVE() is used to save the full name(s) and order of
all open indexes to an array for later restoring with
DC_INDEXRESTORE().
Examples:
use customer index custname, custnmbr, custcode
aIndex := DC_INDEXSAVE()
set index to
index on balance to balance
dc_browsedb()
dc_indexrestore( aIndex )
Source/Library:
_DCDBIND.PRG/.OBJ, DCLIP.LIB
See Also:
dc_indexrestore()
dc_indexsel()
Select an index order or tag by key value
Syntax:
Arguments:
(cKey) is a character string containing any portion of the key
desired.
Returns:
A logical .TRUE. if the index is found and selected, .FALSE.
otherwise.
Description:
DC_INDEXSEL() is used to select an index order by key value
rather than by order number or tag name. This function is
handy when the order of the indexes or the tag name is not
always known.
DC_INDEXSEL() will select the first index tag in the first
index in which the passed argument exists as a substring
anywhere in the index key.
Examples:
use customer
index on CUST_NMBR to custnmbr
index on UPPER(CUST_NAME) to custname
index on CUST_CODE to custcode
set index to custnmbr, custname, custcode
? DC_INDEXSEL( 'CUST_CODE' )
.T.
? DC_INDEXSEL( 'CUST_NAME' )
.T.
? DC_INDEXSEL( 'CUST_NMBR' )
.T.
? DC_INDEXSEL( 'NAME' )
.F.
Source/Library:
_DCDBSEL.PRG/.OBJ, DCLIP.LIB
dc_iniload()
Load an array from a *.INI (initialization) file
Syntax:
Arguments:
(cIniFile) is the name of the *.INI file to load. If the full
path is not included in the file name, then it is assumed that
the file must exist in the same directory as the .EXEcutable
program or in the directory established by the SET DCLIP=(path)
command in your AUTOEXEC.BAT file.
(cGroup) is the Group Name you wish to load.
(aArray) is the array to populate from the contents of the
intialization group. This array must already exist and must
contain default values for each item. Values may be the
following types: (C)haracter, (N)umeric, (D)ate, (L)ogical.
(aReference) is a parallel array that contains the same number
of elements as (aArray). This array contains the name of each
intialization item for each item in (aArray).
Returns:
A logical .TRUE. if the file exists, if the (cGroup) can
be found in the file and if at least one element of the
array was updated from the file, .FALSE. otherwise.
Description:
DC_INILOAD() is used to populate an array with the contents of
an initilization group in a *.INI file. *.INI files are used
by Windows 3.1 for initialization of various sub-systems and
applications and have become a defacto-standard for
initialization systems.
Notes:
(aArray) should be already populated by default values. If
there is no item in the *.INI file that matches a specified
element of the array, then its value will not be changed.
Examples:
/* Sample *.INI file */
* MYCOLORS.INI
[COLORSET_1]
ColorSet=Standard Color Set
DotPrompt=W+/B
StatusLine=N/W
StatusData=N/W
[COLORSET_2]
ColorSet=Color Set #2
DotPrompt=GR+/GR
StatusLine=N*/N
StatusData=W+*/N
/* -- Example 1 (Loading an array from COLORSET_2 -- */
aRef := {'ColorSet','DotPrompt','StatusLine','StatusData'}
DC_INILOAD('MYCOLORS.INI','COLORSET_2',aColors[2],aRef)
Source/Library:
_DCINI.PRG/.OBJ, DCLIP.LIB
See Also:
dc_inisave()
dc_inisave()
Save an array to a *.INI (initialization) file
Syntax:
Arguments:
(cIniFile) is the name of the *.INI file to save. If the full
path is not included in the file name, then it is assumed that
the file must exist in the same directory as the .EXEcutable
program or in the directory established by the SET DCLIP=(path)
command in your AUTOEXEC.BAT file. If the file does not exist
it will be created. If it already exists, then only the GROUP
in the file that matches (cGroup) will be updated.
(cGroup) is the Group Name you wish to save.
(aArray) is the array to write to the initialization group.
This array may contain values of the following types:
(C)haracter, (N)umeric, (D)ate, (L)ogical.
(aReference) is a parallel array that contains the same number
of elements as (aArray). This array contains the name of each
intialization item for each item in (aArray).
Returns:
A logical .TRUE. if the initialization group was properly
saved, FALSE otherwise.
Description:
DC_INISAVE() is used to save an array with the contents of
an initilization group to a *.INI file. *.INI files are used
by Windows 3.1 for initialization of various sub-systems and
applications and have become a defacto-standard for
initialization systems.
Examples:
/* Sample *.INI file */
* MYCOLORS.INI
[COLORSET_1]
ColorSet=Standard Color Set
DotPrompt=W+/B
StatusLine=N/W
StatusData=N/W
[COLORSET_2]
ColorSet=Color Set #2
DotPrompt=GR+/GR
StatusLine=N*/N
StatusData=W+*/N
/* -- Example 1 (Saving an array to COLORSET_2 -- */
aRef := {'ColorSet','DotPrompt','StatusLine','StatusData'}
DC_INISAVE('MYCOLORS.INI','COLORSET_2',aColors[2],aRef)
Source/Library:
_DCINI.PRG/.OBJ, DCLIP.LIB
See Also:
dc_iniload()
dc_init()
Initialize the dCLIP IDE Environment
Syntax:
Arguments:
(lRunTime) if .TRUE. will prevent the dCLIP startup screen and
copyright message from being displayed.
Returns:
NIL
Description:
DC_INIT() is used to initialize the dCLIP environment. This
function reads and loads the DCLIP.SYS file, initializes the
dynamic-link system, the command pre-processor, system color
array, etc.
Notes:
Normal use of dCLIP or most dCLIP functions does not require
that you use DC_INIT() because it is the responsibility of any
function that needs to be initialized to perform the task
itself. For example, the DC_DOT() function, each time it is
called will check to see if the dot-prompt environment is
already initialized and will automatically call DC_INIT() the
first time it is used.
Source/Library:
_DCINIT.PRG/.OBJ, DCLIP.LIB
dc_inkey()
Moused replacement for INKEY()
Syntax:
Arguments:
(nSeconds) is the number of seconds to wait for a key press or
mouse click. If 0 (default) then DC_INKEY() will wait forever.
(@nMouRow) and (@nMouCol) are memory variables passed by
reference to store the current row and column location of the
mouse if a mouse button is pressed.
(lWaitRele) if .TRUE. will wait until the mouse button is
released before processing any more mouse actions. If this
parameter is not passed, then the last call to DC_INKEYRELE()
will establish the default mode.
(lWinMode) if .TRUE. will cause DC_INKEY() to behave more like
Windows programs. Normally, the right-button must be pressed
or the left-button double-clicked for DC_INKEY() to return a
-104 value. If DC_INKEYWIN(.t.) is called in your setup
program and the (lWinMode) parameter is passed to DC_INKEY(),
then simply releasing the left button will return the -104 value
to invoke the menu selection.
(lGetReader) is reserved.
(lNoDblClick) if .TRUE. will disable mouse double-click from
returning a -104 but instead will return a -101 (same as single
click). The default is .FALSE.
(lDragMode) if .TRUE. will return a value of 13 (K_ENTER) if
the left mouse button is pressed. The default is .FALSE.
(cHelpCode) is a code of up to 22 characters to pass to the
DC_HELPF1() function in the event that the F1 or ALT-F1 keys
are pressed.
(aMouseHelp) is an array of information to display on the
screen if the mouse is moved over specified areas (icons) on
the screen. This optional array allows for displaying of help
information when the mouse is placed over a screen area. This
is a 2-dimensional array that consists of a sub-array of screen
coordinates for displaying the message and another sub-array
consisting of a sub-sub-array for each mouse icon area.
(aMouseHelp[1]) is defined as follows:
Element Type Description
------- ---- -------------------------------------
[1] N Start Message display row
[2] N Start Message display column
[3] N End Message display row
[4] N End Message display column
(aMouseHelp[2]) contains one array for each icon and is defined
as follows:
Element Type Description
------- ---- -------------------------------------
[1] N Start Icon display row
[2] N Start Icon display column
[3] N End Icon display row (if element is a NIL
then element [1] is the default)
[4] N End Icon display column (if element is a NIL
then element [2] is the default)
[5] C Message to display when mouse is placed
over element 1-4 screen coordinates
[6] B Optional code-block to disable the message
for this item. Must return a logical .T.
to enable message or .F. to disable message.
The default is .TRUE.
Returns:
0 if no key is pressed before timeout.
The numeric value of the key pressed (same as INKEY() )
-101 if the left mouse button is pressed
-102 if the right mouse button is pressed
-104 if the right mouse button is released, the left
mouse button is double-clicked, or the left mouse
button in released when in "Windows" compatible
mode.
Description:
DC_INKEY() is used to return the integer numeric value of a key
pressed or mouse button. This is designed as a replacement for
INKEY() when it is required that a procedure be called if a
function key is pressed by the operator or a mouse is being
used.
DC_INKEY() will evaluate any functions which have been
previously established by the SET KEY command or SetKey()
function.
DC_INKEY() is also designed for use with a context-specific
help system and the procedures which have been loaded into
function keys by the KEY LOAD command or DC_KEYLOAD().
Examples:
local nRow, nCol
set key -1 to myfunc1
set key -2 to myfunc2
// Call HELP("MYFUNC") if F1 is pressed
// Call MYFUNC1() if F2 is pressed
// Call MYFUNC2() if F3 is pressed
nInkey := DC_INKEY( 'MYFUNC', 0, @nRow, @nCol )
Source/Library:
_DCINKEY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_tbinkey()
dc_inkeyeval()
Post a code block for evaluation by DC_INKEY()
Syntax:
Arguments:
(bBlock) is a code block to evaluate.
Returns:
The last posted DC_INKEYEVAL() code block.
Description:
Many dCLIP functions make calls to DC_INKEY() to get a key.
If you post a code block with DC_INKEYEVAL() before calling
dCLIP functions you can interrupt your application.
Examples:
LOCAL nRow, nCol
DC_INKEYEVAL( {||DevPos(0,0),DevOut(Time())} )
nInkey := DC_INKEY( 'MYFUNC', 0, @nRow, @nCol )
Source/Library:
_DCINKEY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_inkey()
dc_inkeyrelease()
Require mouse to be released or positioned in specified area
Syntax:
Arguments:
If (nSeconds) is 0, then DC_INKEY() will return a value only
if the mouse button is released or the mouse is within the
passed coordinates.
If (nSeconds) is greater than 0 then DC_INKEY() will return
a value only after the specified amount of time .AND. if the
mouse is in the specified coordinates. If coordinates are not
passed, then DC_INKEY() will return a value regardless of the
mouse position.
Returns:
nil
Description:
DC_INKEYRELEASE() is used to insure that DC_INKEY() will only
return a value if the mouse button is released after a
specified amount of time or if the mouse is within a
specified area.
Source/Library:
_DCINKEY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_inkey()
dc_inkeywin()
Make DC_INKEY() behave like Windows
Syntax:
Arguments:
If (lWinMode) is .TRUE.
Returns:
0 if no key is pressed before timeout.
The numeric value of the key pressed (same as INKEY() )
-101 if the left mouse button is pressed
-102 if the right mouse button is pressed
-104 if the right mouse button is released, the left
mouse button is double-clicked, or the left mouse
button in released when in "Windows" compatible
mode.
Description:
This function is used to make DC_INKEY() to return a value
to allow pull-down menus to behave like Windows pull-downs.
Normally, the right-button must be pressed or the left-button
double-clicked for DC_INKEY() to return a -104 value. If
DC_INKEYWIN(.t.) is called in your setup program and the
(lWinMode) parameter is passed to DC_INKEY(), then simply
releasing the left button will return the -104 value to
invoke the menu selection.
Examples:
local nRow, nCol
DC_INKEYWIN(.t.) // set Windows compatible mode
nInkey := DC_INKEY( 'MYFUNC', 0, @nRow, @nCol,,.t.)
Source/Library:
_DCINKEY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_inkey()
dc_insert()
Insert a specified number of records
Syntax:
Arguments:
(nInsertNo) is the number of records to insert. If this
argument is not passed, then the user will be prompted to enter
a number.
The second argument may be a Logical value or an array. If it
is a logical argument ((lVirtual)), then a value of .TRUE. will
insert virtual records using the .DCV file (if it exists) that
corresponds to the associated ALIAS. If (lVirtual) is false,
then BLANK records will be inserted.
If the second argument is an array (aVirtual), then the contents
of the array is used as the virtual record.
Description:
DC_INSERT() will insert a specified number of BLANK or VIRTUAL
records in the currently selected database starting at the
current record pointer.
Examples:
-- Example 1 --
use customer
// create an array from CUSTOMER.DCV
aVirtual := dc_virtrestore()
if valtype( aVirtual ) # 'A'
break
endif
go 25
// insert 10 virtual records starting at record 25
DC_INSERT( 10, aVirtual )
-- Example 2 --
use customer
// insert 5 blank records at the top of the file.
DC_INSERT( 5 )
Source/Library:
_DCINS.PRG/.OBJ, DCLIP.LIB
See Also:
UTIL
dc_util()
INSERT
dc_interpret()
Interpret a command string
Syntax:
Arguments:
The first parameter may be passed as a string containing a
single command or an array containing a procedure. If passed
as a string then (cCommand) is the command line with arguments.
The command line may include any command that can be used at
the dCLIP dot prompt and any command that is included in .CH
files which are loaded with the INCLUDE command or
DC_PREINCLUDE() function. If the first parameter is an array,
then it must conform to the specifications of the array returned
by DC_PROGLOAD().
(aParams) is a single-dimensional array of parameters to pass
to the program being interpreted. There should be one element
in the array for each parameter included in the PARAMETERS
statement in the interpreted program.
Returns:
The value returned by the RETURN (xValue) statement in the
intrepreted program. If no RETURN value is entered into the
program, then a NIL is returned.
Description:
DC_INTERPRET() is a command-line interpreter that will
translate and execute any command that is supported by dCLIP
and/or any command that has been loaded via the pre-processor
commands or functions. DC_INTERPRET() will execute a single
command string or an array of commands that encompass and
entire procedure with passed parameters and a return value.
DC_INTERPRET() was designed to work in conjuction with
DC_PROGRAM() and/or DC_PROGLOAD() which will load a program
from the DCPROG.DBF program catalog, pre-process the program
into a multi-dimensional array, then pass the program to
DC_INTERPRET() for execution.
Examples:
-- Example 1 --
dc_preinclude('MYSTUFF.CH')
aCommands := { 'USE INVOICE',;
'USE INVITEMS NEW',;
'SET RELATION TO INV_NMBR INTO INVOICE',;
'BROWSE TILE',;
'BACKUP',;
'DONE' }
for i := 1 to len(aCommands)
? aCommands[i]
DC_INTERPRET( aCommands[i] )
next
-- Example 2 --
/* Program stored in 'TEST' record of DCPROG.DBF :
PARAMETERS a,b,c,d
CLS
USE CUSTOMER
nReceivables := 0
DO WHILE !EOF()
? 'Record',RecNo()
?? FieldGet(a)
?? FieldGet(b)
?? FieldGet(c)
?? FieldGet(d)
IF !EMPTY(phone1)
?? phone1
ELSEIF !EMPTY(phone2)
?? phone2
ENDIF
nReceivables += balance
ENDDO
RETURN nReceivables
*/
aProgram := DC_ProgLoad('TEST')
nMoneyDue := DC_INTERPRET( aProgram, { 3, 5, 6, 9 } )
? nMoneyDue
wait
Source/Library:
_DCDOT.PRG/.OBJ, DCLIP.LIB
See Also:
dc_progload()
dc_program()
dc_dot()
dc_batch()
dc_isanum()
Is a character Alphanumeric?
Syntax:
Arguments:
(cCharacter) is a character string with a length of 1.
Description:
DC_ISANUM() is used to test whether or not a character is an
alphanumeric character:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
Examples:
? DC_IsAnum('Z')
.T.
? DC_IsAnum('j')
.T.
? DC_IsAnum('4')
.T.
? DC_IsAnum('$')
.F.
Source/Library:
_DCVAL.PBG/.OBJ, DCLIP.LIB
dc_isblank()
Are all the fields in the current record empty?
Syntax:
Arguments:
NONE
Returns:
.TRUE. if all fields are empty, .FALSE. if any field contains
data.
Description:
DC_ISBLANK() is used to report whether or not every field in
the current record of the current workarea is empty.
Examples:
. use sales
. go 10
. ? DC_ISBLANK()
.F.
. dc_blank() // blank out all fields
. ? DC_ISBLANK()
.T.
Source/Library:
_DCBLANK.PRG./.OBJ, DCLIP.LIB
See Also:
dc_blank()
BLANK
dc_isdbfmdx()
Is the current work area using a DBFMDX Driver?
Syntax:
Arguments:
(nArea) is the work area be queried. If no argument is given,
then the current work area is default.
Description:
DC_ISDBFMDX() is used to query a work area to determine if it
has an open database that was opened with the DBFMDX driver.
Examples:
. close all
. use customer via 'DBFMDX'
. ? DC_ISDBFMDX()
.T.
. ? DC_ISDBFMDX( 2 )
.F.
Source/Library:
_DCRDD.PRG/.OBJ, DCLIP.LIB
dc_isdbfndx()
Is the current work area using a DBFNDX Driver?
Syntax:
Arguments:
(nArea) is the work area be queried. If no argument is given,
then the current work area is default.
Description:
DC_ISDBFNDX() is used to query a work area to determine if it
has an open database that was opened with the DBFNDX driver.
Examples:
. close all
. use customer via 'DBFNDX'
. ? DC_ISDBFNDX()
.T.
. ? DC_ISDBFNDX( 2 )
.F.
Source/Library:
_DCRDD.PRG/.OBJ, DCLIP.LIB
dc_isdbfsix()
Is the current work area using a DBFSIX Driver?
Syntax:
Arguments:
(nArea) is the work area be queried. If no argument is given,
then the current work area is default.
Returns:
.TRUE. if the DBFSIX driver is being used with an open database in
(nArea).
Description:
DC_ISDBFSIX() is used to query a work area to determine if it
has an open database that was opened with the DBFSIX driver.
Examples:
. close all
. use customer via 'DBFSIX'
. ? DC_ISDBFSIX()
.T.
. ? DC_ISDBFSIX( 2 )
.F.
Source/Library:
_DCRDD.PRG/.OBJ, DCLIP.LIB, DCLIPS.LIB
dc_isdescend()
Is the current index key Descending?
Syntax:
Arguments:
(nOrder) is the order number of the controlling index. If
no parameter is passed then the current controlling index
will be used.
Returns:
A logical value.
Description:
DC_ISDESCEND() is used to report if the currently selected
index is indexed in descending order. This function will only
report if the DESCEND option was used during indexing, not if
the DESCEND() function was used.
Examples:
use customer
index on cust_name to custname
? DC_ISDESCEND()
.F.
index on cust_name to custname descending
? DC_ISDESCEND()
.T.
index on DESCEND(cust_name) to custname
? DC_ISDESCEND()
.F.
Source/Library:
_DCAREA2.PRG/.OBJ, DCLIP.LIB
dc_isfield()
Is a character string a field in the current work area?
Syntax:
Arguments:
(cFieldName) is the name of the field to test.
@(nPosition) is the position of the field in the database
structure. If the field does not exist, then a 0 will be
return in this variable, otherwise the field position will
be returned.
Returns:
A logical value.
Description:
DC_ISFIELD() is used to determine of a character string is a
valid field in the current work area.
Examples:
LOCAL cFieldName, nPosition
use customer
? DC_ISFIELD('CUST_NMBR',@nPosition)
.T.
? nPosition
12
? DC_ISFIELD('CUST_NMBR+CUST_NAME',@nPosition)
.F.
? nPosition
0
Source/Library:
_DCAREA2.PRG/.OBJ, DCLIP.LIB
dc_isflock()
Is the current data File locked?
Syntax:
Arguments:
(nArea) is the work area be queried. If no argument is given,
then the current work area is default.
Returns:
A logical .TRUE. if the file is locked, .FALSE. otherwise.
Description:
DC_ISFLOCK() reports whether or not a database in a specified
work area is currently locked with a FLOCK().
This function is handy when it is necessary to restore the
condition of a work area after modifying the environment.
Examples:
lFileLocked := DC_ISFLOCK()
do something
if lFileLocked
dc_filock()
endif
Source/Library:
_DCAREA.PRG/.OBJ, DCLIP.LIB
dc_isntxcond()
Is the current work area a DBFNTX Conditional Index driver?
Syntax:
Arguments:
(nArea) is the work area be queried. If no argument is given,
then the current work area is default.
Description:
DC_ISNTXCOND() is used to query a work area to determine if it
has an open database that was opened with the DBFNTX
"Conditional index driver.
Examples:
. close all
// DBFNTX Conditional index is linked into application
. use customer via 'DBFNTX'
. ? DC_ISNTXCOND()
.T.
. ? DC_ISNTXCOND( 2 )
.F.
Source/Library:
_DCRDD.PRG/.OBJ, DCLIP.LIB
dc_ispath()
Is a directory in a path string?
Syntax:
Arguments:
(cPath) is a path string with drive/directories separated
by semicolons.
(cDirectory) is the directory to test.
Returns:
A logical .TRUE. if the directory exists in the path string,
.FALSE. otherwise.
Description:
DC_ISPATH() is used to test if a directory has been listed
in a path string.
Examples:
? DC_ISPATH( GETE('PATH'),'C:\DOS' )
.T.
SET(_SET_PATH,'C:\MYDATA;D:\HISDATA;D:\HERDATA')
? DC_ISPATH( SET(_SET_PATH), 'C:\HISDATA' )
.T.
? DC_ISPATH( SET(_SET_PATH), '\WINDOWS' )
.F.
Source/Library:
_DCPATH.PRG/.OBJ, DCLIP.LIB
See Also:
dc_pathfound()
dc_path()
dc_ispdx()
Is the current work area a PARADOX (PDX) driver?
Syntax:
Arguments:
(nArea) is the work area be queried. If no argument is given,
then the current work area is default.
Description:
DC_ISPDX() is used to query a work area to determine if it has
an open database that was opened with the PDX (PARADOX)
database driver.
Examples:
. close all
. use cust_borr via 'PDX'
. ? DC_ISPDX()
.T.
. ? DC_ISPDX( 2 )
.F.
Source/Library:
_DCRDD.PRG/.OBJ, DCLIP.LIB
dc_isprotmode()
Is the application running in Protected Mode?
Syntax:
Arguments:
NONE
Returns:
A logicl .TRUE. if the application is running in protected
mode.
A logical .FALSE. if the application is running in real mode.
Description:
DC_ISPROTMODE() is used to report whether or not the
application is running in protected mode or in real mode.
Examples:
IF DC_ProtMode()
IF Memory(0)(2000
? 'Memory warning. May not have sufficient memory to run.'
? 'Make sure the operating system allocates at least 2000k'
? 'of VCPI or DPMI memory (Extended Memory)'
wait
ENDIF
ELSE
IF Memory(0)(120
? 'Memory warning. May not have sufficient memory to run.'
? 'Make sure the operating system allocates at least 500k'
? 'of conventional memory and 1500k of EMS (Paged) memory.'
wait
ENDIF
Source/Library:
_DCMEM.PRG./.OBJ, DCLIP.LIB
See Also:
dc_memmeter()
dc_isrdd()
Determine if a specified RDD is available
Syntax:
Arguments:
(cRddName) is the name of the Replaceable Data Driver.
Description:
DC_ISRDD() is used to determine if a specified Replaceable Data
Driver is linked into the running application.
Examples:
accept "enter a file name to open" to cFileName
accept "enter a Data Driver" to cRdd
if DC_ISRDD( cRdd )
use &cFileName via cRdd
else
? 'Data driver ' + cRdd is not available
endif
Source/Library:
_DCRDD.PRG/.OBJ, DCLIP.LIB
See Also:
dc_rddsel()
dc_setrdd()
SET RDD
dc_isrlock()
Is the current Record locked?
Syntax:
Arguments:
(nArea) is the work area be queried. If no argument is given,
then the current work area is default.
Returns:
A logical .TRUE. if the file is locked, .FALSE. otherwise.
Description:
DC_ISRLOCK() reports whether or not the current record in a
specified work area is currently locked with an RLOCK().
This function is handy when it is necessary to restore the
condition of a work area after modifying the environment.
Examples:
lRecLocked := DC_ISRLOCK()
nRecSave := recno()
do something
goto nRecSave
if lRecLocked
dc_reclock()
endif
Source/Library:
_DCAREA.PRG/.OBJ, DCLIP.LIB
dc_isshared()
Is the current workarea file opened in Shared mode?
Syntax:
Arguments:
(nArea) is the work area be queried. If no argument is given,
then the current work area is default.
Returns:
A logical .TRUE. if the database was opened in SHARED mode,
.FALSE. if it was opened in EXCLUSIVE mode.
Description:
DC_ISSHARED() is used to report whether a database in a
specified work area was opened in SHARED mode or EXCLUSIVE.
Examples:
-- Example 1 --
use customer shared
? DC_ISSHARED()
.T.
-- Example 2 --
FUNCTION pack
if DC_ISHARED()
? 'Exclusive USE is required to pack a file'
else
pack
endif
Source/Library:
_DCAREA.PRG/.OBJ, DCLIP.LIB
dc_isstru()
Verify the structure of the current database
Syntax:
Arguments:
(aStructure) is a multi-dimensional array with one sub-array
for each database field.
Element Type Description
------ ---- ------------------------
[1] C Field Name
[2] C Field Type
[3] N Field Length
[4] N Field Decimals
[5] Any Default Data (optional)
Returns:
A logical .TRUE. if (aStructure) matches the structure
of the current workarea, .FALSE. otherwise.
Description:
DC_ISSTRU() is used to verify that the current database matches
a structure from a Clipper or dCLIP structure array.
Examples:
aStru := { ;
{ 'CUST_NAME','C',25,0 },;
{ 'CUST_NMBR','C',10,0 },;
{ 'LAST_DATE','D',8,0 } }
use customer
if .not. DC_ISTRU( aStru )
dc_struupdate( aStru )
endif
Source/Library:
_DCSTRU.PRG/.OBJ, DCLIP.LIB
See Also:
dc_dbfile()
dc_struupdate()
dc_modstru()
dc_isunique()
Is the current index a Unique index?
Syntax:
Arguments:
(nArea) is the work area. If no argument is passed then the
current work area will be reported.
Description:
DC_ISUNIQUE() is used to report if the currently selected index
is indexed UNIQUE (i.e. No duplicate keys in index ).
Examples:
use customer
index on cust_name to custname
? DC_ISUNIQUE()
.F.
index on cust_name to custname unique
? DC_ISUNIQUE()
.T.
Source/Library:
_DCAREA.PRG/.OBJ, DCLIP.LIB
dc_join()
Pop-up a user-prompt menu for joining databases
Syntax:
Description:
DC_JOIN() is a high-level function that provides a
user-interface menu for joining records in two work areas.
DC_JOIN() prompts the user for information about files and
scoping conditions (with pick-list options), then displays a
progress- Odometer during the joining process followed by the
final tally results.
Examples:
use cust1
use cust2
DC_JOIN()
Source/Library:
_DCJOIN.PRG/.OBJ, DCLIP.LIB
dc_keybuffer()
Save and Clear the Keyboard Buffer
Syntax:
Arguments:
None.
Returns:
An array of numeric values equal to the INKEY() values of
each key in the keyboard buffer.
Description:
DC_KEYBUFFER() will read the contents of the keyboard buffer
and save each INKEY() value to an array, then clear the buffer.
The array may then be passed to DC_PUTKEY() to fill the buffer
again.
Examples:
LOCAL aKeys := DC_KEYBUFFER()
DO something
DC_PutKey( aKeys )
Source/Library:
_DCPUTK.PRG/.OBJ, DCLIPR.LIB
See Also:
dc_putkey()
dc_keyclear()
Clear Set-Keys previously loaded from Key Dictionary
Syntax:
Arguments:
(cKeyGroup) is an 8-character name that defines the key group
to clear. This must be a group that was previously loaded
with the DC_KEYLOAD() function.
If an array (aKeyGroup) is passed in lieu of a character
string, then the array must conform to the specification of
the array that is returned by the function DC_KEYGET().
If no argument is passed then all Setkeys() that were
loaded via all calls to DC_KEYLOAD() will be restored to
their original value.
Returns:
A logical .TRUE. if the keys were successfully cleared, .FALSE.
otherwise.
Description:
DC_KEYCLEAR() is used to clear SetKeys() that were loaded
from the DC_KeyLoad() function. Each key will be restored
to the original value that it contained before it was
loaded with DC_KeyLoad().
Examples:
-- Example 1 --
IF DC_KeyLoad( "MYKEYS" )
DO SOMETHING
DC_KEYCLEAR() // Clear all keys
ENDIF
-- Example 2 --
aKeyGroup1 := DC_KeyGet( "F1THRUF10" ) // Get F1 thru F10
IF DC_KeyLoad( aKeyGroup1 )
DO PROGRAM1
aKeyGroup2 := DC_KeyGet( "DEBUG" ) // Get Debug keys
IF DC_KeyLoad( aKeyGroup2 )
DO PROGRAM2
DC_KEYCLEAR( aKeyGroup2 ) // Clear Debug keys
ENDIF
DO PROGRAM3
DC_KEYCLEAR( aKeyGroup1 ) // Clear Func Keys
ENDIF
Source/Library:
_DCKEY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_keyload()
KEY CLEAR
dc_keycount()
Return the number of "active" records
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.
(nTimeOut) is the amount of time (in seconds) to allow
DC_KEYCOUNT() to calculate the number of records. If the
database is too large or the computer is too slow, this
calculation may take too much time to be practical. If the
calculation takes longer than (nTimeOut) then -1 will be
returned.
Returns:
1. If there is no controlling index and no filter set then
the total number of records in the database will be
returned.
2. If there is a controlling index and it is not a conditional
index then the total number of records in the database will
be returned.
3. If there is a controlling index and it is also a
conditional index then the number of keys in the index will
be returned.
4. -1 if the calculation times out.
5. If values are passed for xTop and/or xBottom and there is a
controlling index, then the number of records between the
xTop and xBottom values will be returned.
Description:
DC_KEYCOUNT() is used to calculate the number of "active"
records in a database. This is accomplished by using a
special agorithm that skips through the index in a manner
must faster than simply skipping one record at a time and
counting records. In many cases, this calculation can be
accomplished in a fraction of a second, however, conditions
can exist that may require a several seconds.
Examples:
// calculate the number of customers between C and L.
use customer index custname
? DC_KEYCOUNT( 'C','L', 5 )
Source/Library:
_DCAREA2.PRG/.OBJ, DCLIP.LIB
See Also:
dc_keyno()
dc_keydelete()
Delete a Key Group from the Key Dictionary
Syntax:
Arguments:
(cKeyGroup) is an 8-character name that defines the key group
to deleteg from the Key Dictionary file.
If no parameter is passed, then a pick-list of Key Groups
(in the Key Dictionary) will be displayed.
Returns:
A logical .TRUE. if the keys were successfully deleted, .FALSE.
otherwise.
Description:
DC_KEYDELETE() is used to delete a group of keys from the
Key Dictionary file. The default name of the Key Dictionary
is DCKEY.DBF.
Examples:
DC_KEYDELETE( "MYKEYS" )
Source/Library:
_DCKEY.PRG/.OBJ, DCLIP.LIB
See Also:
KEY DELETE
KEY EDIT
dc_keydisp()
Display the contents of Function Keys
Syntax:
Arguments:
NONE
Description:
DC_KEYDISP() is used to display the titles of function keys
which have been loaded by the dCLIP commands KEY EDIT or KEY
LOAD or the dCLIP functions DC_KEYEDIT() or DC_KEYLOAD().
A four-line display of the function key TITLES will be
displayed starting at the top line of the display. This is a
quick-reference display to be used as a reminder for what is
loaded into the function keys.
Examples:
dc_keyload() // load the keys
DC_KEYDISP() // display the keys
Source/Library:
_DCKEY.PRG/.OBJ, DCLIP.LIB
See Also:
KEY EDIT
dc_keyedit()
dc_keyedit()
Edit a Key Group Definition in the Key Dictionary
Syntax:
Arguments:
(cKeyGroup) is an 8-character name that defines the key group
to load into the editor from the Key Dictionary file. If the
Key Group does not exist in the DCKEY.DBF dictionary file,
then if an array file named (cKeyGroup).DCK does exist, it
will be used to load the keys for editing.
If neither an array file exists or the key group does not
exist in the Dictionary file, then a pick-list of Key Groups
(in the Key Dictionary) will be displayed. If an array
(aKeyGroup) is passed in lieu of a character string, then the
array must conform to the specification of the array that is
returned by the function DC_KEYGET().
Returns:
An array that conforms to the specification defined in
the function DC_KEYGET().
Description:
DC_KEYEDIT() is an editor that is used to maintain the
Key Dictionary database for storing Hot-Key definitions.
This function allows for loading existing Key Group
definitions for editing, adding a new Key Group definition
or creating a new Key Group definition from items tagged
from the "TEMPLATE" Key Group.
A group of Keys with the Name "TEMPLATE" is stored in
the DCKEY.DBF database. This set of keys is used to
define the Key Names and Inkey() values for all Function
keys (F1 thru Alt-F10), Control (CTRL) keys and Alternate
(ALT) keys.
Notes:
The DCKEYS.DBF database and its associated indexes will
be created by DC_KeyOpen() if they do not already exist.
Examples:
-- Example 1 --
aKeyGroup := DC_KeyGet( "MYKEYS" ) // Load array
aKeyGroup := DC_KEYEDIT( aKeyGroup ) // Edit array
DC_KeyLoad( aKeyGroup ) // Load keys
-- Example 2 --
DC_KEYEDIT( "TEMPLATE" )
Source/Library:
_DCKEY.PRG/.OBJ, DCLIP.LIB
See Also:
KEY EDIT
dc_keyload()
dc_keyfile()
Establish the file and alias name for the Key Dictionary
Syntax:
Arguments:
(cKeyFile) is the name that defines the database file to
be used as the Key Dictionary file. The default file name
is DCKEY.DBF and the alias is DCKEY. If the file doesn't
exist it will be created.
(cKeyAlias) is the alias name (up to 8 characters) to use.
If this parameter is not passed, then the alias will be
given the same name as (cKeyFile).
Returns:
Nil
Description:
DC_KEYFILE() is used to define the name of the file to use as
the Key Dictionary. If the file does not already exist it
will be created. The default name of the Key Dictionary is
DCKEY.DBF.
Notes:
DC_KEYLOAD() in dCLIP version 4.0 and later works slightly
different than previous versions. In earlier versions, there
was only one Key Group for the 40 "Function Keys", ie F1 thru
Alt-F10. The first parameter passed to DC_KEYLOAD() in previous
versions was the Key file name. Now that DC_KEYLOAD() supports
so many new features, it has been designed for use with Key
Groups. To post a file name to use other than the DCKEY.DBF
default database, use this DC_KEYFILE() function.
Examples:
DC_KEYFILE( "C:\MYDATA\MYKEYS.DBF" )
IF DC_KeyLoad( "DEFAULT" ) // Load Default keys
DO SOMETHING
DC_KeyClear() // Clear all keys
ENDIF
Source/Library:
_DCKEY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_keyopen()
dc_keyget()
Load a Key Group array from the Key Dictionary
Syntax:
Arguments:
(cKeyGroup) is an 8-character name that defines the key group
to load from the Key Dictionary file. If the Key Group does
not exist in the DCKEY.DBF dictionary file, then if an
array file named (cKeyGroup).DCK does exist, it will be
used to load the array.
If neither an array file exists or the key group does not
exist in the Dictionary file, then a pick-list of Key Groups
(in the Key Dictionary) will be displayed.
(lSave2Array) if .TRUE. (default) will also store the loaded
Key Group to a STATIC array. This will improve the speed
of reloading Key Groups that are loaded and unloaded often
within a program. Each time DC_KEYGET() is called it checks
to see if the Key Group exists in the STATIC array before
going to the Key Dictionary file. If .FALSE., then the
Key Group will need to be reloaded each time from the file
but less runtime memory will be used.
Returns:
An array that contains the definitions of each key in the
Key Group. This is a multi-dimensional array that is 2
elements long.
The first element is an array that defines the general
information about the key group:
Element Type Description
------- ---- ------------------------------------------
[1] C Key Group name (up to 8 characters)
[2] C Key Group description
[3] L Key Group is Active
The second element is an array that consists of one
sub-array for each key definition:
Element Type Description
------- ---- ------------------------------------------
[1] C Key ID Tag (up to 6 characters)
[2] C Key Name
[3] N Key INKEY value (-40 to 421)
[4] C Key Contents (string, macro, procedure name)
[5] C Key Description (what it does)
[6] C Key Code (S)tring, (M)acro, (P)rocedure
(D)isable, (N)ormal, (U)ndefined
[7] L Key Enable (allow loading)
[8] B Code Block containing previous SetKey() value
Description:
DC_KEYGET() is used to load an array with a Key Group
definition from the Key Dictionary database.
Before using this function, be sure to use the KEY EDIT command
or the DC_KEYEDIT() function to set up the strings, macros,
or procedures you want to load into specified hot keys.
Examples:
aKeyGroup := DC_KEYGET( "MYKEYS" ) // Load Key Group
DC_KeyLoad( aKeyGroup ) // Set the Keys
DC_BrowseDb() // Call Browse
DC_KeyClear( aKeyGroup ) // Restore old keys
Source/Library:
_DCKEY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_keyedit()
KEY LOAD
dc_keyhelp()
Display the status of Keys that are loaded
Syntax:
Arguments:
None.
Returns:
Nil
Description:
DC_KEYHELP() will display the status of all keys that
have been loaded with DC_KEYLOAD() in a scrollable
window. This function will display the name of keys are
set to perform SetKey() functions. If the key was set
using DC_KEYLOAD(), then a description of the key action
will also be displayed next to the key name, otherwise
the key action will be displayed as "Function Unknown".
Examples:
DC_KeyLoad( "FUNCTION" ) // Load Function keys
DC_KeyLoad( "MAIN" ) // Load Main keys
bHelpKey := SetKey(28, {||DC_KEYHELP()})
DO SOMETHING
SetKey( 28, bHelpKey )
Source/Library:
_DCKEY.PRG/.OBJ, DCLIP.LIB
See Also:
KEY HELP
dc_keyload()
dc_keyincr()
Increment an Index key value to aid in setting a scope
Syntax:
Arguments:
(xKeyVal) is a value that matches the same type as the index
key.
Returns:
A value equal to the (xKeyVal) plus the next logical
increment.
Description:
DC_KEYINCR() is used to increment an index key value to
the next possible value. This can be used with the
SOFTSEEK seeking capability to find the last record in
a database that matches a key value. This is accomplished
by adding a character, number, date or logical value to
the current key value that when seeking with SOFTSEEK ON
will position the record pointer to the next record after
the last record that matches a specified value. The
record pointer can then be positioned to the last record
that matches the specified value by SKIP -1.
Examples:
-- Example 1 --
cKeyVal := 'COMPUTERS'
/* -- Find first record that matches "COMPUTERS"
SEEK cKeyVal
nTopRec := RecNo()
/* -- Find last record that matches "COMPUTERS"
SET SOFTSEEK ON
SEEK( DC_KEYINCR(cKeyVal) )
SKIP -1
nBotRec := RecNo()
-- Example 2 --
cKeyVal := "MASTER"
? DC_KEYINCR( cKeyVal )
MASTES
Source/Library:
_DCAREA2.PRG/.OBJ, DCLIP.LIB
dc_keyload()
Load Keys from a Key Group array or Key Dictionary
Syntax:
Arguments:
(cKeyGroup) is an 8-character name that defines the key group
to load from the Key Dictionary file. If the Key Group does
not exist in the DCKEY.DBF dictionary file, then if an
array file named (cKeyGroup).DCK does exist, it will be
used to load the keys.
If neither an array file exists or the key group does not
exist in the Dictionary file, then a pick-list of Key Groups
(in the Key Dictionary) will be displayed. If an array
(aKeyGroup) is passed in lieu of a character string, then the
array must conform to the specification of the array that is
returned by the function DC_KEYGET().
Returns:
A logical .TRUE. if the keys were successfully loaded, .FALSE.
otherwise.
Description:
DC_KEYLOAD() is used to load a group of keys from the
definition contained in the Key Dictionary file. The default
name of the Key Dictionary is DCKEY.DBF.
Before using this function, be sure to use the KEY EDIT command
or the DC_KEYEDIT() function to set up the strings, macros,
or procedures you want to load into specified hot keys.
Notes:
DC_KEYLOAD() in dCLIP version 4.0 and later works slightly
different than previous versions. In earlier versions, there
was only one Key Group for the 40 "Function Keys", ie F1 thru
Alt-F10. The first parameter passed to DC_KEYLOAD() in previous
versions was the Key file name. Now that DC_KEYLOAD() supports
so many new features, it has been designed for use with Key
Groups. To post a file name to use other than the DCKEY.DBF
default database, use the function DC_KEYFILE().
When you first start up dCLIP or your application, the function
keys are all blank. The DCKEY.DBF database is a means of
keeping your commonly used commands, phrases, procedure calls,
etc. stored away to load your hot keys at any time. You
may invoke an automatic KEY LOAD command at the startup of
dCLIP or during DC_INIT() by including the commands
KEYFILE=(cKeyFile) and KEYLOAD=(cKeyGroup) in your DCLIP.SYS
file.
Examples:
-- Example 1 --
IF DC_KEYLOAD( "MYKEYS" )
DO SOMETHING
DC_KeyClear() // Clear all keys
ENDIF
-- Example 2 --
aKeyGroup1 := DC_KeyGet( "F1THRUF10" ) // Get F1 thru F10
IF DC_KEYLOAD( aKeyGroup1 )
DO PROGRAM1
aKeyGroup2 := DC_KeyGet( "DEBUG" ) // Get Debug keys
IF DC_KEYLOAD( aKeyGroup2 )
DO PROGRAM2
DC_KeyClear( aKeyGroup2 ) // Clear Debug keys
ENDIF
DO PROGRAM3
DC_KeyClear( aKeyGroup1 ) // Clear Func Keys
ENDIF
Source/Library:
_DCKEY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_keyedit()
KEY LOAD
dc_keyname()
Display the name of a key from its INKEY value
Syntax:
Arguments:
(nInkeyVal) is any Inkey() value from -40 to 421.
Returns:
A character string.
Description:
DC_KEYNAME() will return the name of a key from an Inkey()
value. The names of all keys are stored in the DCKEY.DBF
database in the "TEMPLATE" key group. DC_KEYNAME() uses
the names that are stored in this database.
Examples:
? DC_KEYNAME( 24 )
Down Arrow
? DC_KEYNAME( 306 )
Alt-M
Source/Library:
_DCKEY.PRG/.OBJ, DCLIP.LIB
See Also:
KEY HELP
dc_keyhelp()
dc_keyno()
Return the ordinal position of the current record
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.
(nTimeOut) is the amount of time (in seconds) to allow
DC_KEYNO() to calculate the number of records. If the
database is too large or the computer is too slow, this
calculation may take too much time to be practical. If the
calculation takes longer than (nTimeOut) then -1 will be
returned.
@(nKeyCount) is the name of a memory variable to save the
number of active records. This count is the same as
returned by DC_KEYCOUNT().
Returns:
1. If there is no controlling index and no filter set then
the current record number (RECNO()) will be returned.
2. If there is a controlling index then the ordinal position
of the current record within the index will be returned.
3. -1 if the calculation times out, a filter is set or the
SET_DELETED flag is ON and the number of records is
greater than 1000. Calculating the ordinal position with
a filter or deleted flag can be too slow on very large
databases.
4. If values are passed for xTop and/or xBottom and there is
a controlling index, then the ordinal position of the
current record between the xTop and xBottom values will
be returned.
Description:
DC_KEYNO() is used to calculate the ordinal position of the
current record in an "indexed" database. This is
accomplished by using a special agorithm that skips through
the index in a manner must faster than simply skipping one
record at a time and counting records. In many cases, this
calculation can be accomplished in a fraction of a second,
however, conditions can exist that may require a several
seconds.
Examples:
use customer index custname
? DC_KEYNO()
1
skip 100
? DC_KEYNO()
101
Source/Library:
_DCAREA2.PRG/.OBJ, DCLIP.LIB
See Also:
dc_keycount()
dc_keyopen()
Open the Key Dictionary file
Syntax:
Arguments:
None
Returns:
A logical .TRUE. if the files were successfully opened,
.FALSE. otherwise.
Description:
DC_KEYOPEN() is used to open the Key Dictionary file and its
associated index file. If the database file does not exist
or the index file does not exist or contains the wrong key
they will be recreated.
Examples:
DC_KEYOPEN()
Source/Library:
_DCKEY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_keyfile()
dc_keyorder()
Return the index order based on a Field Name
Syntax:
Arguments:
(cFieldName) is the name of a field in the current work area.
Returns:
A numeric value equivalent to the index order containing
the specified field name. If an index cannot be found
that contains the specified field, then DC_KEYORDER() will
return 0.
Description:
DC_KEYORDER() is used to determine which index is the
controlling order for a specified field name. This is
a handy function for determining which index order to
select when browsing a database by field name and it
is desirable to set the record order to the order of the
column selected.
Examples:
use customer index cust1, cust2, cust3, cust4
dbSetOrder( DC_KEYORDER( "cust_nmbr" ) )
Source/Library:
_DCAREA2.PRG/.OBJ, DCLIP.LIB
dc_keypick()
Pop-up a pick-list of all Key Groups in Key Dictionary
Syntax:
Arguments:
None.
Returns:
A character string of up to 8 characters.
Description:
DC_KEYPICK() is used to pop-up a pick-list of all Key Groups
in the DCKEY.DBF Key Group Dictionary File.
Examples:
/* This example demonstrates how to use DC_KEYPICK()
to pop-up a pick-list of Key-Groups in a GET */
#include 'dcget.ch'
LOCAL aKeyGroup := SPACE(8)
@ 10,10 say 'Enter Key Group Name ' GET cKeyGroup ;
VALID DC_ReadClick( cKeyGroup, {|k|DC_KEYPICK()} ) ;
PICKLIST
Source/Library:
_DCKEY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_keyedit()
dc_keyrestore()
Restore SET KEYs from array created by DC_KEYSAVE()
Syntax:
Arguments:
(aSetKeys) is a multi-dimensional array created by
DC_KEYSAVE().
Returns:
NIL
Description:
DC_KEYRESTORE() is used to restore all SET KEYs that were saved
by DC_KEYSAVE().
Examples:
aKeys := dc_keysave() // save away all SET KEYs
SET KEY -1 to myfunc1
SET KEY 28 to help
SET KEY 54 to myfunc2
do something
DC_KEYRESTORE( aKeys ) // restore keys
return
Source/Library:
_DCSETK.PRG/.OBJ, DCLIP.LIB
See Also:
dc_keysave()
dc_keysave()
Save all SET KEYS to an array and clear keys
Syntax:
Arguments:
(lClear) if .TRUE. will clear all set keys after they are saved
to the array. If .FALSE. (default), the current status of the
SET KEYs will be retained.
(aKeySet) is an optional array of keys by INKEY() value to
save. If no parameter is passed, then all keys from -47 to 421
will be save.
Returns:
An array of code-blocks which are pointers to all currently active
SET KEY procedures.
Description:
DC_KEYSAVE() will save the current value of all SET KEYs to an
array for later restoring with DC_KEYRESTORE(). Use this
function to save set keys before calling any procedure which
may modify the SET KEY environment.
Examples:
aKeys := DC_KEYSAVE() // save away all SET KEYs
SET KEY -1 to myfunc1
SET KEY 28 to help
SET KEY 54 to myfunc2
do something
dc_keyrestore( aKeys ) // restore keys
return
Source/Library:
_DCSETK.PRG/.OBJ, DCLIP.LIB
See Also:
dc_keyrestore()
dc_keystore()
Store a Key Group array to the Key Dictionary
Syntax:
Arguments:
(aKeyGroup) is an array that conforms to the specification
of the array returned by DC_KEYGET().
Returns:
A logical .TRUE. if the Key Group was successfully saved,
.FALSE. otherwise.
Description:
DC_KEYSTORE() is used to store the contents of a Key Group
array to the Key Dictionary database.
If a Key Group with the same name already exists in the
Key Dictionary it will be overwritten.
Examples:
aKeyGroup := DC_KeyGet( "MYKEYS" ) // Load Key Group
aKeyGroup := DC_KeyEdit( aKeyGroup ) // Edit the Keys
DC_KEYSTORE( aKeyGroup ) // Store the keys
Source/Library:
_DCKEY.PRG/.OBJ, DCLIP.LIB
See Also:
dc_keyget()
KEY LOAD