#include FOXPRO.H
#include REGISTRY.H

* Product names.

#define ccFULL_PRODUCT_NAME     'Stonefield Database Toolkit'
#define ccREG_PRODUCT_NAME      'Stonefield DBC Toolkit'
#define ccSDT_VERSION           'V3.0'
#define ccCODEBOOK_NAME         'Codebook'
#define ccCODEBOOK_VERSION      'V3.2'
#define ccDBCX_NAME             'DBCX'

* Control characters.

#define ccNULL                  chr(0)
#define ccCR                    chr(13)
#define ccTAB                   chr(9)
#define ccFIELD_TERMINATOR      chr(13)

* Strings to substitute in error and other messages.

#define ccMSG_INSERT1           '<Insert1>'
#define ccMSG_INSERT2           '<Insert2>'
#define ccMSG_INSERT3           '<Insert3>'

* Error messages.

#define ccERR_DB_NOT_OPEN       'The database <Insert1> is not open.'
#define ccERR_NO_DB_OPEN        'No database is open.'
#define ccERR_TABLE_NOT_OPEN    '<Insert1> is not open.'
#define ccERR_TABLE_NOT_FOUND   'The table <Insert1> was not found in the database.'
#define ccERR_NO_SUCH_TABLE     'The table <Insert1> was not found.'
#define ccERR_NO_EXTENSIONS     'The Stonefield extensions defined for <Insert1> are incomplete - <Insert2>.'
#define ccERR_NO_TABLE_SELECTED 'No table was specified.'
#define ccERR_TABLE_IN_DBC      '<Insert1> is already in the database.'
#define ccERR_FILE_EXISTS       '<Insert1> already exists.'
#define ccERR_FILE_NOT_EXIST    'File <Insert1> does not exist.'
#define ccERR_CANNOT_OPEN       '<Insert1> could not be opened.'
#define ccERR_INDEX_EXISTS      'There is already an index with that name.'
#define ccERR_FIELD_EXISTS      'There is already a field with that name.'
#define ccERR_PROP_EXISTS       'There is already a property with that name.'
#define ccERR_FILE_IN_USE		'File is in use.'
#define ccERR_TOO_MANY_FILES	'Too many files open.'
#define ccERR_PARAM_INVALID     'The parameters are invalid.'
#define ccERR_TAG_NOT_FOUND     'Tag <Insert1> was not found.'
#define ccERR_NO_TABLES         'There are no tables defined in this database.'
#define ccERR_CANT_OPEN_EXCL    '<Insert1> cannot be opened exclusively.'
#define ccERR_NOT_OPEN_EXCL     '<Insert1> must be opened exclusively.'
#define ccERR_OUT_OF_MEMORY     'Insufficient memory.'
#define ccERR_INDEX_INVALID     'Tag <Insert1> is invalid.'
#define ccERR_IDX_EXPR_INVALID  'The index expression is invalid.'
#define ccERR_FILTER_TOO_LONG   'The filter expression is too long.'
#define ccERR_CANT_REINDEX      '<Insert1> could not be reindexed - <Insert2>.'
#define ccERR_NO_FIELD          'No field was specified.'
#define ccERR_PRIM_COMPOUND     'The primary key for <Insert1> is a compound key.'
#define ccERR_CANT_EXTEND       'Cannot extend <Insert1>.'
#define ccERR_DBC_NOT_OPEN      'The database is not open as a table.'
#define ccERR_NO_PHDBASE        'PHDBASE is needed to create index <Insert1> of <Insert2> but it could not be loaded.'
#define ccERR_BELONG_ANOTHER    'This table belongs to another database.'
#define ccERR_INVALID_PROPERTY  '<Insert1> is not a valid property.'
#define ccERR_INVALID_DBCXPROPS 'Invalid property cursor name.'
#define ccERR_CANT_UPDATE_ID    'Unable to update the last used row ID.'
#define ccERR_CANT_ADD_META     'You are not allowed to add a meta data table to the database.'
#define ccERR_INVALID_OBJ_TYPE  '<Insert1> is not a valid object type.'
#define ccERR_INVALID_DEMO      'The demo version of Stonefield Database Toolkit can only be used with the sample database.'
#define ccERR_INVALID_COLLATE   'This code page does not support the <Insert1> collate sequence used for tag <Insert2>.'
#define ccERR_NOT_UPDATED       'There was a problem updating this table. Its structure was not changed.'
#define ccERR_VCX_NOT_EXIST     'The class library selected for field <Insert1> (<Insert2>) does not exist.'
#define ccERR_CANT_SAVE_PREF    'There is a problem saving properties.'
#define ccERR_CANT_DEF_PREF     'There is a problem registering default properties.'
#define ccERR_CANT_EDIT_PROP    'The SDT meta data table cannot be opened exclusively, so you cannot add, edit, or remove extended properties at this time.'
#define ccERR_NO_TABLES_IN_DIR  'There are no tables in that directory.'
#define ccERR_WORD_NOT_FOUND    'Microsoft Word could not be found.'
#define ccERR_WORD_DOC_OPEN     'Another document with this name is already open in Word.'
#define ccERR_WORD_BUSY         'Word appears to be busy doing something else right now.'
#define ccERR_WORD_NO_BOOKMARK  'The template for this report has been modified such that the expected bookmark no longer exists.'
#define ccERR_WORD_NOT_STARTED  'Microsoft Word could not be started.'
#define ccERR_WORD_UNKNOWN_NAME 'There is a problem in the VBA commands sent to Word.'
#define ccERR_WORD_CLOSED       'Word was closed so it will be restarted.'
#define ccERR_BAD_FIELD_REP_DIR 'The Field Repository directory defined in the SDT Properties form conflicts with the meta data for the current database. Please edit this property in SDT Properties.'
#define ccERR_OLE_NOT_REG       '<Insert1> is not properly registered on this computer.'

* Display messages.

#define ccMSG_REGISTER_TO_DBCX  'Registering <Insert1> to DBCX...'
#define ccMSG_TITLE             'Stonefield Database Explorer'
#define ccMSG_READONLY          '[Read Only]'
#define ccMSG_CREATING          'Creating <Insert1>...'
#define ccMSG_UPDATING          'Updating <Insert1>...'
#define ccMSG_REMOVING          'Removing <Insert1>...'
#define ccMSG_COPYING           'Copying <Insert1>...'
#define ccMSG_MOVING            'Moving <Insert1>...'
#define ccMSG_PACKING           'Packing <Insert1>...'
#define ccMSG_REINDEXING        'Reindexing <Insert1>...'
#define ccMSG_REPAIRING         'Repairing <Insert1>...'
#define ccMSG_PROCESSING        'Processing <Insert1>...'
#define ccMSG_CHECKING          'Checking <Insert1>...'
#define ccMSG_VALIDATING        'Validating database...'
#define ccMSG_OPEN_DATABASE     'Database:'
#define ccMSG_COPYRIGHT         '(c) 1996 Stonefield Systems Group Inc.'
#define ccMSG_RETR_EXT_PROP     'Retrieving extended properties...'
#define ccMSG_UPD_EXT_PROP      'Updating extended properties...'
#define ccMSG_UPDATING_META     'Updating meta data table structures...'
#define ccMSG_OPENING           'Opening <Insert1>...'
#define ccMSG_RECORDS_TOTAL     '<Insert1>   records total'
#define ccMSG_DOING_INDEX       'Index <Insert1> of <Insert2>'
#define ccMSG_RENAME_EDITS      'The following objects must be edited since their properties refer to the former name of <Insert1>:'
#define ccMSG_REMOVE_EDITS      'The following objects must be edited since their properties refer to <Insert1>:'
#define ccMSG_RENAME_FIELD      'Renaming field...'
#define ccMSG_REPAIR            'Repair'
#define ccMSG_REINDEX           'Reindex'
#define ccMSG_PROGRESS          'Progress'
#define ccMSG_ERROR             'Error:  '
#define ccMSG_METHOD            'Method: '
#define ccMSG_LOCATE            '<Insert1>:'
#define ccMSG_OPEN              'Open'
#define ccMSG_PLEASE_WAIT       'Please wait...'
#define ccMSG_PRINTING          'Printing documentation. Press Esc to cancel ...'
#define ccMSG_DIRECTORY         'Select directory'
#define ccMSG_READING_DBC       'Reading database objects...'

* Form captions and labels.

#define ccFRM_SDT_CAPTION       'Stonefield Database Explorer - '
#define ccFRM_TD_CAPTION        'Stonefield Extended Table Designer - '
#define ccFRM_PROPS_CAPTION     'Other <Insert1> Properties'
#define ccFRM_PREF_CAPTION      'Stonefield Database Explorer Properties'
#define ccFRM_SYSDOC_CAPTION    'Database Documentation'
#define ccFRM_IDXWIZ_CAPTION    'Index Wizard'
#define ccFRM_NOTIFY_CAPTION    'Note'
#define ccFRM_SELDBC_CAPTION    'Select Database'
#define ccFRM_NEW_PROP_CAPTION  'New Property'
#define ccFRM_NEW_LVIEW_CAPTION 'New Local View'
#define ccFRM_NEW_RVIEW_CAPTION 'New Remote View'
#define ccFRM_EDIT_PROP_CAPTION 'Edit Property'
#define ccFRM_TD_RECORDS        'Records:  <Insert1>'
#define ccFRM_TD_FIELDS         'Fields:  <Insert1>'
#define ccFRM_TD_LENGTH         'Length:  <Insert1>'
#define ccFRM_SORT_ORDER        'Sort Order'
#define ccFRM_TD_DEF_CLASS      '<Default>'

* Questions.

#define ccQST_REMOVE_TABLE      'Remove <Insert1> and any views or relations based on it from the database?'
#define ccQST_NOT_EXCLUSIVE     '<Insert1> could not be opened exclusively. Would you like to view it in read-only mode?'
#define ccQST_NO_EXTENSIONS     'There are no Stonefield extensions defined for this database. Do you want to add them?'
#define ccQST_REMOVE_REL_INDEX  'This index is involved in one or more relations, and removing it will also remove those relations. Are you sure you want to remove it?'
#define ccQST_REMOVE_INDEX      'Remove this index?'
#define ccQST_REMOVE_FIELD      'Remove this field?'
#define ccQST_REMOVE_EXT_PROP   'Remove this extended property?'
#define ccQST_REMOVE_IDX_FIELD  'This field is involved in one or more indexes. Removing it will also remove those indexes and any relations based on those indexes. Are you sure you want to remove it?'
#define ccQST_DEBUG             'Display the debugger?'
#define ccQST_EXIT_NO_SAVE      'Exit without saving your changes?'
#define ccQST_BAD_DBCPATH       'Warning: at least one meta data record (ID #<Insert1>) references a database that either no longer exists or has been moved. Continuing will result in this meta data record being deleted. Do you want to continue?'
#define ccQST_MOVE_TABLE        'Moving <Insert1> will cause any views or relations based on it to be removed. Do you wish to continue?'
#define ccQST_VALIDATE          'Validating the meta data can take quite a while. Are you sure you want to proceed?'
#define ccQST_REMOTE_VIEW       'Should this be a remote view?'

* Font's we'll use.

#define ccMONOFONT              iif(_MAC, 'Courier', 'Courier New')
#define cnMONOSIZE              9
#define ccMONOSTYLE             'N'
#define ccPROPFONT              iif(_MAC, 'Geneva', 'Arial')
#define cnPROPSIZE              9
#define ccPROPSTYLE             'N'

* SDT Preferences Registry Keys

#define ccPREF_LISTACTION       'ListAction'
#define ccPREF_DBCXREG_SAME_DIR 'DBCXREG Same Directory As DBC'
#define ccPREF_DBCXREG_SPEC_DIR 'DBCXREG Specific Directory'
#define ccPREF_ASK_FOR_DBCXREG  'Ask for DBCXREG Location'
#define ccPREF_SHOW_INTL        'Show International'
#define ccPREF_NAMING_CONV      'Codebook naming convention'
#define ccPREF_DBC_SELECTION    'Database Selection'
#define ccPREF_DBC_SPEC_DIR     'Database Specific Directory'
#define ccPREF_USE_CURRENT_DBC  'Use current database'
#define ccPREF_ALWAYS_ASK_DBC   'Always ask for database'
#define ccPREF_ASK_IF_MANY      'Ask if more than one open'
#define ccPREF_OPEN_DBC_IN_DIR  'Open database in specific directory:'
#define ccPREF_FIELD_REP_DIR    'Field Repository Directory'

* Report constants.

#define ccREP_TOT_SIZE          'Total record size:'
#define ccREP_SYSTEM            'System:'
#define ccREP_DATABASE          'Database:'
#define ccREP_TABLE             'Table:'

* Miscellaneous constants.

#define ccMENU_BAR_PROMPT_SDT   'Stonefield \<Database Toolkit'
	* Prompt for the pad in the menu bar
#define ccMENU_BAR_PROMPT_PREF  'SDT \<Properties...'
	* Prompt for the Properties pad in the menu bar
#define cnBORDER                 4
	* the number of pixels added to the width of a 3-D textbox
	* (2 pixels left + 2 pixels right)
#define cn3DBORDER               0
	* the value of SpecialEffect for a 3-D border
#define cnSPNWIDTH              31
	* extra space needed around spinners
#define cnTAB_HEIGHT            30
	* the height of a pageframe tab
#define ccALL                   'ALL'
	* "ALL" passed to Reindex or Update
#define ccUNTITLED              'Untitled'
	* string returned by GETFILE() when New is selected
#define ccDELETED_TAG_COMMENT   'This tag improves Rushmore performance.'
#define ccMETA_TABLE            'meta table'
#define ccTABLES_PROPER         'Tables'
#define ccDATABASE_PROPER       'Database'
#define ccTABLES                'tables'
#define ccTABLE                 'Table'
#define ccVIEW                  'View'
#define ccVIEWS_PROPER          'Views'
#define ccINDEXES               'indexes'
#define ccFIELD_PROPER          'Field'
#define ccINDEX_PROPER          'Index'
#define ccRELATIONS             'relations'
#define ccDATABASE              'database'
#define ccTHIS_TABLE            'this table'
#define ccRENAMED_FIELDS        'the following field(s)'
#define ccPACK                  'Pack'
#define ccALL_TABLES            'All Tables'
#define ccCANCEL                'Cancel'
#define ccSELECT                'Select'
#define ccLIBRARY               'Field Repository'
#define ccLIBRARY_TABLE         '_LIBRARY'
#define ccBROWSE                'Browse'
#define ccLIST                  'List'
#define ccYES                   'Yes'
#define ccNO                    'No'
	* the action to take when the user double-clicks in the main form tree
#define ccREG_KEY               'Software\Stonefield Systems Group Inc.\SDT\5.0\Properties'
	* Windows 95/NT registry key for preferences
#define ccCOMMDLG_CANCEL_MSG    'Cancel was selected'

**************************
*     VFP Constants      *
**************************

* VFP index types.

#define ccPRIMARY               'Primary'
#define ccREGULAR               'Regular'
#define ccCANDIDATE             'Candidate'
#define ccUNIQUE                'Unique'

* VFP base classes for Intellidrop.

#define cnBASE_CLASSES          10
#define ccDEFAULT_CLASS         '<Default>'
#define ccCHECKBOX              'Checkbox'
#define ccCOMBOBOX              'Combobox'
#define ccEDITBOX               'Editbox'
#define ccGRID                  'Grid'
#define ccLISTBOX               'Listbox'
#define ccOLEBOUNDCONTROL       'OLEBoundControl'
#define ccOPTIONGROUP           'OptionGroup'
#define ccSPINNER               'Spinner'
#define ccTEXTBOX               'Textbox'

* LLFF error numbers.

#define cnLLFF_ERR_NOT_FOUND    2
	* File not found
#define cnLLFF_ERR_TOO_MANY     4
	* Too many files open
#define cnLLFF_ERR_NO_ACCESS    5
	* Access denied
#define cnLLFF_ERR_OUT_MEMORY   8
	* Out of memory
#define cnLLFF_ERR_OTHER        31
	* Error opening file

* Other error numbers.

#define cnVF_ERR_BELONGANOTHER  1565
	* Table belongs to another database
#define cnVF_ERR_BELONGANOTHER2 1537
	* Table belongs to another database
#define cnVF_ERR_ALIAS_NOTFOUND   13
	* Alias is not found.
#define cnVF_ERR_ARRAYDIM        230
   * Bad array dimensions.
#define cnVF_ERR_EXECCANCELLED  1523
	* Execution cancelled by user
#define cnVF_ERR_FILE_IN_USE       3
	* File is in use
#define cnVF_ERR_ACCESS_DENIED  1705
	* File access denied
#define cnVF_ERR_OLE_ERROR      1429
	* OLE error
#define cnVF_ERR_OLE_EXEC_FAIL  1426
	* OLE error: remote procedure call failed
#define cnVF_ERR_NO_CLASS_DEFN  1733
	* Class definition not found

* DBF and FPT header information.

#define cnDBF_VFP_SIGNATURE     48
	* 30H
#define cnDBF_CDX_BIT           28
#define cnDBF_CODE_PAGE         29
#define cnDBF_FIRST_FIELD       32
#define cnDBF_FIELD_DEFN_SIZE   32
#define cnDBF_FIELD_NAME_SIZE   10
#define cnDBF_SYSTEM_FIELD       5
#define cnDBF_HEADER_LENGTH      8
#define cnDBF_NUM_RECORDS        4
#define cnDBF_RESERVED_BYTES1   16
	* number of reserved bytes (first set) in the DBF header
#define cnDBF_RESERVED_BYTES2    2
	* number of reserved bytes (second set) in the DBF header
#define cnDBF_RESERVED_BYTES3   13
	* number of reserved bytes in a field definition
#define cnDBF_HAS_MEMO           2
	* the CDX/FPT flag byte value for a table with a memo file
#define ccDBF_NULL_FLAGS        '_NullFlags'
	* the name of the _NullFlags field
#define ccDBF_NULL_FLAGS_TYPE   '0'
	* the type of the _NullFlags field
#define cnDBF_FIELDFLAG_SYSTEM   1
	* the field flag setting for a system field
#define cnDBF_FIELDFLAG_NULL     2
	* the field flag setting for field that accept null values
#define cnDBF_FIELDFLAG_BINARY   4
	* the field flag setting for a binary field type
#define ccDBF_NEW_TYPES          'YTBI'
#define cnFPT_DEFAULT_BLOCK_SIZE 64
#define cnFPT_HEADER_SIZE        512
#define cnFPT_BLOCK_SIZE_DIVISOR 512

* DBC object types padded to the length of the OBJECTTYPE field and using the
* same case.

#define cnVF_OBJ_TYPESIZE       10
#define ccVF_OBJ_CONNECTION     'Connection'
#define ccVF_OBJ_DATABASE       'Database  '
#define ccVF_OBJ_FIELD          'Field     '
#define ccVF_OBJ_INDEX          'Index     '
#define ccVF_OBJ_RELATION       'Relation  '
#define ccVF_OBJ_TABLE          'Table     '
#define ccVF_OBJ_VIEW           'View      '
#define ccVF_OBJ_STOREDPROCSRC  'StoredProceduresSource'
#define cnVF_OBJID_DATABASE      1

* AERROR() array dimensions, including added extensions.

#define cnVF_AERR_MAX           7
#define cnVF_AERR_NUMBER        1
#define cnVF_AERR_MESSAGE       2
#define cnVF_AERR_OBJECT        3
#define cnVF_AERR_WORKAREA      4
#define cnVF_AERR_TRIGGER       5
#define cnVF_AERR_EXTRA1        6
#define cnVF_AERR_EXTRA2        7
#define cnAERR_MAX              cnVF_AERR_MAX + 3
#define cnAERR_METHOD           cnVF_AERR_MAX + 1
#define cnAERR_LINE             cnVF_AERR_MAX + 2
#define cnAERR_SOURCE           cnVF_AERR_MAX + 3

* DBC property IDs.

#define cnVF_TABLE_FILEPATH      1
#define cnVF_OBJ_SUBTYPE         2
#define cnVF_REL_TAG            13
#define cnVF_INDEX_TAGTYPE      17
#define cnVF_REL_FKTABLE        18
#define cnVF_REL_FKTAG          19
#define cnVF_TABLE_PRIMARYTAG   20
#define cnVF_VIEW_SQL           42
#define cnVF_VIEW_TABLES        43
#define cnVF_VIEWFLD_UPDATENAME 35

* DBC property values.

#define ccVF_IND_REGULAR        chr(0)
#define ccVF_IND_CANDIDATE      chr(1)
#define ccVF_OBJ_LOCALTABLE     chr(1)
#define ccVF_OBJ_LOCALVIEW      chr(6)

* VFP limits.

#define cnVF_LONGNAME_LENGTH    128
	* the length of a long name
#define cnVF_BACKLINK_LENGTH    263
	* the length of the database backlink in the DBF header
#define cnVF_INDEX_MAXKEYLEN    240
	* the length of an index expression
#define cnVF_INDEX_MAXNAMELEN    10
	* the length of a tag name
#define cnVF_FIELD_MAXCOUNT     255
	* the maximum # of fields
#define cnVF_FIELD_MAXNAMELEN    10
	* the length of a "real" field name

* FOXPRO.INT file constants.

#define ccVFP_INT_FILE          'FOXPRO.INT'
#define cnVFP_INT_HEADER        100
#define cnVFP_INT_BLOCKSIZE      16

* Other FoxPro constants.

#define cnVFP_LOCAL_VIEW        1
	* The value returned by DBGETPROP('SourceType') for local views.

**************************
*    Other Constants     *
**************************

* Word errors.

#define cnWORD_ERR_DOC_OPEN     57
#define cnWORD_ERR_COMM_UNAVAIL 5003
#define cnWORD_ERR_NO_BOOKMARK  5

* Common Dialog constants.

#define ccFILEDLG_OVERWRITE     0x2
#define ccFILEDLG_HIDERO        0x4
#define ccFILEDLG_SHOWHELP      0x10
#define ccFILEDLG_MULTIPLE      0x200
#define ccFILEDLG_PATHEXIST     0x800
#define ccFILEDLG_FILEEXIST     0x1000
#define ccFILEDLG_PROMPTNEW     0x2000
#define ccFILEDLG_SHAREAWARE    0x4000
