If you know some FoxPro (matchIT uses Visual FoxPro) or dBase (known as "xBASE") programming, you can use the System Commands utility to key in simple xBASE commands. The System Commands facility is not intended to replace any requirement for a full FoxPro licene rather than the run-time one included with mDesktop, and your support provider does not provide telephone support, Online Help or documentation for program commands other than the examples below.
As all files are closed when you select the System Commands option from the Tools menu, you will have to first use the database you want, or select it after keying any command that requires a database.
Some FoxPro commands that you might find useful are (type the command in the box then click "Process Command"):
- To open a database file for use by other commands:
USE ?
(then select the database)
- To set the order of a database:
SET ORDER TO UNIQUE_REF (if the index exists)
INDEX ON ADDRESS1 TO TEMP (if the index doesn't exist)
- To browse (view) a database:
BROWSE
(This allows various facilities to reposition on a different record, seek a key etc. through the Browse menu)
- To delete all records from a database from the current record onwards:
DELETE REST
In this example, REST is a scope clause - scope clauses can be added to all the commands below. Other examples of scope clauses are ALL, NEXT 100, NEXT 9999 etc.
- To recall logically deleted records from a database for a condition:
RECALL FOR condition
- To delete all records from a database which have blank addressee AND company fields, OR blank address lines 1, 2 and 3:
DELETE ALL FOR (EMPTY(ADDRESSEE) AND EMPTY(COMPANY)) OR (EMPTY(ADDRESS1) AND EMPTY(ADDRESS2) AND EMPTY(ADDRESS3))
In this example, FOR specifies a condition clause - you can combine condition clauses with AND and OR and use brackets to control the way in which the conditions are combined. Note the additional brackets in this example, surrounding the first condition (to the left of the OR) and the second condition (to the right of the OR)
- To initialize a field called LISTSOURCE to a value 'ABC' if it is blank, for a given range of unique reference numbers:
REPLACE ALL LISTSOURCE WITH 'ABC' FOR EMPTY(LISTSOURCE) AND BETWEEN(UNIQUE_REF, '0001000', '0099999')
- To copy records for various list sources to another file and then delete them from the first file:
COPY TO drive:path\filename FOR INLIST(LISTSOURCE, 'ABC', 'XYZ', '123' etc.)
DELETE FOR INLIST(LISTSOURCE, 'ABC', 'XYZ', '123' etc.)
- To create a copy of the file in a sorted order:
SORT TO drive:path\filename ON fieldname1, fieldname2, fieldname3 etc. FOR condition