Difference between revisions of "SET COMPATIBLE"
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 21: | Line 21: | ||
In Recital Terminal Developer, if SET COMPATIBLE is issued with no ON, OFF or TO clause, the Xbase Compatibility Settings dialog is displayed. This allows the system-wide Language and Database Compatibility settings to be selected. These correspond to the SET COMPATIBLE and SET FILETYPE settings and once saved are written to the ''compat.db'' file, which will be run every time Recital Terminal Developer is started. The ''compat.db'' file resides in the Recital Terminal Developer home directory. The following choices are available: | In Recital Terminal Developer, if SET COMPATIBLE is issued with no ON, OFF or TO clause, the Xbase Compatibility Settings dialog is displayed. This allows the system-wide Language and Database Compatibility settings to be selected. These correspond to the SET COMPATIBLE and SET FILETYPE settings and once saved are written to the ''compat.db'' file, which will be run every time Recital Terminal Developer is started. The ''compat.db'' file resides in the Recital Terminal Developer home directory. The following choices are available: | ||
+ | |||
* Recital | * Recital | ||
Line 30: | Line 31: | ||
* Clipper 5 | * Clipper 5 | ||
* Clipper ’87 | * Clipper ’87 | ||
+ | |||
The Xbase Compatibility Settings dialog is also displayed the first time you start Recital Terminal Developer after a new install or at any subsequent startup when the ''compat.db'' file does not exist in the Recital Terminal Developer home directory. | The Xbase Compatibility Settings dialog is also displayed the first time you start Recital Terminal Developer after a new install or at any subsequent startup when the ''compat.db'' file does not exist in the Recital Terminal Developer home directory. |
Revision as of 13:52, 15 April 2009
Contents
- 1 Class
- 2 Purpose
- 3 Syntax
- 4 See Also
- 5 Description
- 5.1 ADIR()
- 5.2 DBF()
- 5.3 FMT()
- 5.4 MDX()
- 5.5 NDX()
- 5.6 File specifications
- 5.7 ==
- 5.8 AFIELDS()
- 5.9 COPY TO ARRAY
- 5.10 DTOS()
- 5.11 SET FULLPATH
- 5.12 ARRAY
- 5.13 BROWSE
- 5.14 INDEXORDER() | ORDER()
- 5.15 MENU()
- 5.16 PROGRAM() | PROCNAME()
- 5.17 SELECT([<expN>])
- 5.18 SET()
- 5.19 SYS(5)
- 5.20 ASTORE()
- 5.21 CREATE
- 5.22 FILE()
- 5.23 GOTO
- 5.24 MEMOEDIT()
- 5.25 PARAMETERS
- 5.26 PUBLIC | PRIVATE
- 5.27 SAVE | RESTORE SCREEN
- 5.28 SECONDS()
- 5.29 SKIP 0
- 5.30 VERSION()
- 5.31 {}
- 5.32 ENDFUNC
- 5.33 ENDPROC
- 5.34 FUNCTION | PROCEDURE
- 5.35 ID()
- 6 Example
- 7 Products
Class
Xbase Compatibility
Purpose
Enhance Recital’s compatibility with other Xbase products
Syntax
SET COMPATIBLE [[TO] ON | OFF]
SET COMPATIBLE TO DBASE3 | DBASE4 | DB4 | FOXPRO | FOXPLUS | FOXBASE | CLIPPER | CLIPPER5 | RECITAL | VFP
See Also
APPEND, CHANGE, DB_COMPMULICOMM, DB_FOXMEM, DB_FOXPLUSBUGS, DB_FOXPROKEYS, EDIT, EDITFIELD(), FILETYPE(), INDEXEXT(), SET CLIPPER, SET CLIPPER5, SET EDITFIELD, SET FILECASE, SET FILETYPE, SET INDEXEXT, SET MEMOEXT, SET PCEDIT, SET PCEXACT, SET PCFILTER, SET PCGRAPHICS, SET PCKEYS, SET PCLOCKING, SET PCPICTURE, SET PCSAYS, SET PCUNIQUE
Description
The SET COMPATIBLE command is used to enhance compatibility with other Xbase products. Certain functions and commands behave differently depending on which keyword is used with the SET COMPATIBLE command.
In Recital Terminal Developer, if SET COMPATIBLE is issued with no ON, OFF or TO clause, the Xbase Compatibility Settings dialog is displayed. This allows the system-wide Language and Database Compatibility settings to be selected. These correspond to the SET COMPATIBLE and SET FILETYPE settings and once saved are written to the compat.db file, which will be run every time Recital Terminal Developer is started. The compat.db file resides in the Recital Terminal Developer home directory. The following choices are available:
- Recital
- Visual FoxPro
- FoxPro
- FoxBase
- dBASE IV
- dBase 3
- Clipper 5
- Clipper ’87
The Xbase Compatibility Settings dialog is also displayed the first time you start Recital Terminal Developer after a new install or at any subsequent startup when the compat.db file does not exist in the Recital Terminal Developer home directory.
The keywords ON, DBASE4, and DB4 perform the same function, that is, provide compatibility with dBase IV.
When SET COMPATIBLE is set to any mode except RECITAL, the following SET commands are turned on. SET PROMPT is also set to ’.’.
- SET PCEXACT
- SET PCUNIQUE
- SET PCFILTER
- SET PCLOCKING
- SET PCKEYS
In any compatibility mode other than RECITAL, the AGAIN clause of the USE command allows the same table to be reopened in another workarea in the same session.
Language | Memo | Index | Production |
---|---|---|---|
DBASE3 | dbt | ndx | mdx |
DBASE4 | dbt | ndx | mdx |
CLIPPER | dbt | ntx | |
FOXBASE | dbt | idx | cdx |
FOXPRO | fpt | idx | cdx |
VFP | fpt | idx | cdx |
When COMPATIBLE is set to FOXPRO | VFP, the following changes apply:
ADIR()
ADIR() is compatible with FoxPro behavior.
DBF()
If SET FULLPATH is ON the full path to the database table is returned, if SET FILECASE is OFF then the return value is converted to upper case (Windows only).
FMT()
If SET FULLPATH is ON the full path to the format file is returned, if SET FILECASE is OFF then the return value is converted to upper case (Windows only).
MDX()
If SET FULLPATH is ON the full path to the index file is returned, if SET FILECASE is OFF then the return value is converted to upper case (Windows only).
NDX()
If SET FULLPATH is ON the full path to the index file is returned, if SET FILECASE is OFF then the return value is converted to upper case (Windows only).
When COMPATIBLE is set to FOXBASE | FOXPLUS | FOXPRO | VFP, the following changes apply:
File specifications
File specifications can also be character expressions, e.g. APPEND FROM DBF(2). In other compatibility modes, the character expression must be enclosed in parentheses, e.g. APPEND FROM (DBF(2)).
==
The == operator always operates as an ’exact match’ operator and does not allow wildcard pattern matching.
AFIELDS()
If SET COMPATIBLE is set to FOXPRO | FOXPLUS | FOXBASE | VFP the array need not be pre-defined, it will be created automatically.
COPY TO ARRAY
If SET COMPATIBLE is set to FOXPRO | FOXPLUS | FOXBASE | VFP the array need not be pre-defined, it will be created automatically.
DTOS()
The DTOS() function, when used on an empty date, will return a string of 8 spaces rather than a string of 8 zeroes.
SET FULLPATH
SET FULLPATH is set ON by default.
When compatibility is set to DBASE4 or to FOXBASE | FOXPLUS | FOXPRO | VFP the following changes apply:
ARRAY
The word ARRAY is recognized as an optional keyword to the LOCAL, PUBLIC, PRIVATE and DECLARE commands when compatibility is set to DBASE4 or FOXPRO. Normally, Recital allows the word ARRAY to be used as a memory variable name.
BROWSE
When BROWSE is activated in a window the BROWSE menu will not be shown until the [MENUBAR] key is pressed. Normally the BROWSE menu is displayed when BROWSE is activated.
INDEXORDER() | ORDER()
The INDEXORDER() and ORDER() functions will return the name of the master .ndx or master .dbx tag instead of the ordinal number of the index in the index list.
MENU()
The MENU() function will return the name of the activated menu instead of the ordinal number of the menu item chosen.
PROGRAM() | PROCNAME()
The PROGRAM() and PROCNAME() functions return a string in upper case instead of a string in lower case.
SELECT([<expN>])
If <expN> is 0, the SELECT() function will return the currently selected workarea. If <expN> is 1, the SELECT() function will return the highest available empty workarea.
SET()
The SET() function will return a string instead of a logical value. In many cases, when SET COMPATIBLE is set to DB4, SET() will return ON or OFF. In other cases SET() will return a setting, for example, SET("BORDER") might return DOUBLE.
SYS(5)
The SYS(5) function will return ’C:’
When SET COMPATIBLE is set to CLIPPER the following commands and functions are affected.
ASTORE()
The ASTORE() function will not trim the strings that are stored in the array passed to ASTORE().
CREATE
In a program the command CREATE <filename> will create an empty table with the following structure.
Name | Type | Width | Description |
---|---|---|---|
FIELD_NAME | Character | 32 | Field name |
FIELD_TYPE | Character | 1 | Field data type |
FIELD_LEN | Numeric | 3 | Width of fields |
FIELD_DEC | Numeric | 3 | Number of decimals |
FILE()
The FILE() function will not concatenate ’.dbf’ to the parameter, if the parameter passed does not have a file extension.
GOTO
If the record number qualifier of the GOTO command is less than zero or greater than the number of records, an error message is not generated and EOF() is set to TRUE and FOUND() is set to FALSE.
MEMOEDIT()
The parameters that are passed to MEMOEDIT() are compatible with CLIPPER.
PARAMETERS
If fewer parameters are passed to a procedure or a function than are declared with the PARAMETERS statement, the extra variables are set to type UNDEFINED instead of LOGICAL.
PUBLIC | PRIVATE
Memory variables created with a PUBLIC or PRIVATE statement are created with a type of UNDEFINED. The TYPE() function will return "U" for undefined variables.
SAVE | RESTORE SCREEN
The SAVE and RESTORE SCREEN command without any qualifiers, will only SAVE and RESTORE one screen. Normally Recital allows 20 screens to be saved and restored.
SECONDS()
The SECONDS() function will return the same value as SECS() function.
SKIP 0
When a SKIP 0 command is executed, the record buffer is flushed to disk. This command is most useful when used in validation procedures that are called from forms and REPLACE commands are used within the validation procedure.
VERSION()
The VERSION() function will have a different value as outlined below:
Language | VERSION() |
---|---|
DB4 | dBASE IV 2.0 |
CLIPPER | Clipper Summer ’87 |
CLIPPER5 | Clipper 5 |
FOXPLUS | FoxBASE+ 2.10 |
FOXPRO | FoxPro 2.6 |
VFP | Visual FoxPro 06.00 for Windows |
{}
When SET COMPATIBLE is set to CLIPPER5, curly braces ’{}’ are interpreted as array size delimiters, not date delimiters.
When SET COMPATIBLE is set to VFP, the following changes apply:
ENDFUNC
The ENDFUNC command can be used to terminate a function. If no explicit return value is set, the return value will be .T. (true).
ENDPROC
The ENDPROC command can be used to terminate a procedure. If no explicit return value is set, the return value will be .T. (true).
FUNCTION | PROCEDURE
FUNCTION and PROCEDURE definitions in procedure libraries do not require a RETURN statement (or ENDFUNC | ENDPROC) as they will be terminated by the next FUNCTION | PROCEDURE definition. The FUNCTION command supports parameter declaration in the format FUNCTION function-name(parameter-list).
ID()
The ID() function returns a string in the following format, returning the machine id and the user id rather than just the user id:
MACHINEID # userid
Example
set compatible dbase4 ?set("talk") ON set compatible recital ?set("talk") .T.
Products
Recital Database Server, Recital Mirage Server, Recital Terminal Developer