ID: Q112471
The information in this article applies to:
FoxPro version 2.6 ignores some commands in a dBASE IV created format file if a BROWSE FORMAT command is issued.
NOTE: The extra commands in a format file are ignored only during a BROWSE FORMAT command. The EDIT, CHANGE, APPEND, and READ commands do not ignore the extra commands in the format file.
FoxPro and dBASE format files differ in functionality. FoxPro allows only @ ... SAY, @ ... GET, and COLOR commands in a format file, whereas dBASE allows other program commands.
FoxPro provides for the use of other commands through the Screen Builder power tool, which is the replacement for the dBASE format file. The FoxPro Migration tool, MIGRATE.APP, will convert dBASE .FMT files into FoxPro .SCX files. To run the Migration tool, choose Convert dBASE Files from the Run menu in FoxPro version 2.6.
This behavior is by design.
1. Create a file named CUSTOMER.FMT with the following commands:
*------------------------------------------------------------------
* Name.......: CUSTOMER.FMT
* Version....: dBASE IV, Format 2.0
* Notes......: Format files use "" as delimiters!
*------------------------------------------------------------------
*-- Format file initialization code -------------------------------
*-- Some of these PRIVATE variables are created based on CodeGen
*-- and may not be used by your particular .FMT file
PRIVATE ll_talk, ll_cursor, lc_display, lc_status, ll_carry, ;
lc_proc
IF SET("TALK") = "ON"
SET TALK OFF
ll_talk = .T.
ELSE
ll_talk = .F.
ENDIF
ll_cursor = SET("CURSOR") = "ON"
SET CURSOR ON
lc_display = SET("DISPLAY")
lc_status = SET("STATUS")
*-- SET STATUS was ON when you went into the Forms Designer.
IF lc_status = "OFF"
SET STATUS ON
ENDIF
*-- @ SAY GETS Processing. ----------------------------------------
*-- Format Page: 1
@ 1,0 SAY "CNO"
@ 1,4 GET cno PICTURE "XXXXXX"
@ 2,0 SAY "CONTACT"
@ 2,4 GET contact PICTURE "XXXXXXXXXXXXXXXXXXXX"
@ 3,0 SAY "COMPANY"
@ 3,4 GET company PICTURE "XXXXXXXXXXXXXXXXXXXXXXXXX"
*-- Format file exit code -----------------------------------------
*-- SET STATUS was ON when you went into the Forms Designer.
IF lc_status = "OFF" && Entered form with status off
SET STATUS OFF && Turn STATUS "OFF" on the way out
ENDIF
IF .NOT. ll_cursor
SET CURSOR OFF
ENDIF
IF SET( "DISPLAY" ) <> lc_display
SET DISPLAY TO &lc_display. && Reset Screen size if changed
ENDIF
RELEASE lc_fields,lc_STATUS
IF TYPE( "ll_echo" ) = "L"
IF ll_echo
SET ECHO ON
ENDIF
ENDIF
IF ll_talk
SET TALK ON
ENDIF
*-- EOP: CUSTOMER.FMT
2. Issue the following commands in the Command window:
USE customer
SET FORMAT TO customer.fmt
BROWSE FORMAT
FoxPro will ignore all commands except @ ... SAY, @ ... GET, and COLOR
commands.
This behavior is by design to eliminate the "Syntax error" message that occurs in previous versions of FoxPro.
Additional reference words: FoxDos FoxWin 2.60 KBCategory: kbprg kbprb KBSubcategory: FxinteropDbase
Last Reviewed: June 28, 1995