Differences between FoxPro and Visual FoxPro

This article was previously published under Q129976
This article has been archived. It is offered "as is" and will no longer be updated.
FoxPro Programmers moving to Microsoft Visual FoxPro from earlier versions of Microsoft FoxProwill find that many things have changed dramatically, includingterminology, the programming tools, and even the programming style.

This article is a comprehensive reference that lists the differencesbetween Visual FoxPro and earlier versions of FoxPro to help make thetransition easier.

This article discusses major changes in Visual FoxPro in the followingareas:
  Terminology              Interface      Tools  Language                 Keystrokes     Screens  Tables and Databases     Menus          Reports and Labels				
Most of this information is also available in separate, smaller Help topicsin the Visual FoxPro Help file.

Terminology differences

Visual FoxPro redefines some FoxPro version 2.6 terms. For more informationon new terms, please see the Glossary in the Visual FoxPro Help file.
FoxPro Version 2.6 Term   Visual FoxPro Term---------------------------------------------@ ... GET field           text box controlBlanks or empty           Null valuesfields or variablesBrowse (in a Form)        Grid controlBuffer                    Record and table buffers and transactions.                          (See "Buffering Access to Data" and "Using                          Transactions" in the Visual FoxPro Help file.)Code snippets             Properties, methods, and event code.                          (See "Setting Properties at Design Time" and                          "Assigning Method and Event Code" in the Visual                          FoxPro Help file.)Control                   ControlDatabase                  DatabaseEdit region               EditBox controlLong names                Long names.                          (See "Visual FoxPro Naming Rules" in the Visual                          FoxPro Help file.)Object                    ObjectPopup                     ComboBox controlPower tools               Visual designers and toolboxs.                          (See "Using Designers" and "Using Toolbars" in                          the Visual FoxPro Help file.)PushButton                CommandButton controlRadio button              OptionButton controlScreen                    FormScreen picture            Image controlScreen set                Form setTable                     TableText                      Label control				

Language Differences

Although Visual FoxPro includes new commands as well as FoxPro version 2.6commands for backward compatibility, many FoxPro version 2.6 commands andfunctions have enhanced or modified functionality in Visual FoxPro.

Visual FoxPro allows long names for windows, objects, tables, andvariables. You can use up to 254 characters, except for field names in freetables and index tags. (For details, please see "Visual FoxPro NamingRules" in the Visual FoxPro Help file.)
FoxPro 2.6 clause, command,       Visual FoxPro command, function,function, or feature              property, event, or method---------------------------------------------------------------------@ ... SAY                         Left Property, Top property@ ... SAY PICTURE                 Image, OLE BoundBORDER                            BorderStyle propertyMOVE WINDOW CENTER                AutoCenter propertyColor                             ColorSourceForeColor, BackColor propertyColor scheme                      ForeColor property, BackColor property,                                  ColorScheme propertyDate data type                    Date Data Type and Date Time TypeDBCONNECT                         SQLCONNECT( ) FunctionDBEXEC                            SQLEXEC( ) FunctionDEACTIVATE MENU,                  Deactivate EventDEACTIVATE POPUP,DEACTIVATE WINDOW@ ... GET DEFAULT                 Default propertyDEFINE WINDOW CLOSE               Closable propertyDEFINE WINDOW FLOAT               Movable propertyDEFINE WINDOW HALFHEIGHT          HalfHeightCaption propertyDEFINE WINDOW ICON FILE           Icon propertyEMPTY( ), BLANK( ) to check       ISNULL( ) to check for null valuesfor non-existent data             representing unknown or non-existent dataEnable, Disable                   Enabled propertyFont (Text Menu)                  FontName propertyFont size (Font dialog)           FontSize propertyFont style bold (Font dialog)     FontBold propertyFont style italic (Font dialog)   FontItalic property@ ... SAY FUNCTION,               Format propertyany @ ... GET FUNCTIONHeight                            Height propertyHorizontal position               Left property(Screen Layout dialog)@ ... GET MESSAGE cMessageText    StatusBarText propertyMODIFY SCREEN                     MODIFY FORM commandMODIFY STRUCTURE                  TABLE DesignerNumeric data type                 Numeric data type plus Float field type,                                  Integer field type, Double field type,                                  and Currency data typePicture                           InputMask propertyREAD ACTIVATE                     ReadActivate eventREAD CYCLE                        ReadCycle propertyREAD DEACTIVATE                   ReadDeactivate eventREAD LOCK                         ReadLock propertyREAD NOMOUSE                      ReadMouse propertyREAD SAVE                         ReadSave propertyREAD SHOW                         ReadShow eventREAD TIMEOUT                      ReadTimeout propertyREAD VALID                        ReadValid eventREAD WHEN                         ReadWhen eventScreen Name                       NameSET NOCPTRANS                     (See "Preventing Translation of Data in                                  Character or Memo Fields" in the Visual                                  FoxPro Help file)SHOW GET, SHOW GETS               Refresh methodSize (Screen Layout dialog)       Height, Width propertiesStyle (Font dialog)               FontBold, FontItalic, FontUnderline                                  properties, FontShadow property,                                  FontOutline property, FontStrikeThru                                  propertyTerminate on selection            TerminateRead property(Screen Builder)Title (Screen Builder)            Caption propertyValid (Screen Builder)            Click event, DblClick event, LostFocus                                  event, Valid eventValid Error                       ErrorMessageVertical position                 Top property(Screen Layout dialog)When (Screen Builder)             GotFocus event, When eventWidth (Screen Builder)            Width property				

Table and database differences

Visual FoxPro distinguishes between tables and databases. Although FoxProversion 2.6 tables are fully functional in Visual FoxPro, if you modify thetable structure of FoxPro tables, they are saved as Visual FoxPro tables.
FoxPro 2.6 feature                Visual FoxPro featureor functionality                  or functionality----------------------------------------------------------------------Character field with NOCPTRANS    Character (BINARY) field type.characteristic                    (See "Data and Field Types"                                  in the Visual FoxPro Help file.)General field size                Now 4 bytes. (See "General Field Type" in                                  the Visual FoxPro Help file.)Memo field size                   Now 4 bytes. (See "Memo Field Type" in                                  the Visual FoxPro Help file.)Memo field with NOCPTRANS         Memo (BINARY) field type. (See "Data andcharacteristic                    Field Types" in the Visual FoxPro Help                                  file.)Numeric fields                    Currency data type, Double field type,                                  Float field type, Integer field type, or                                  Numeric data type.OLE data in a General field       OLE Bound Control.				
Visual FoxPro tables can accept null values. To prevent errors generated byattempts to store null values to FoxPro version 2.6 variables or to VisualFoxPro controls, initialize variables or arrays. To prevent users fromattempting to store null values to tables, you can disable the NULL-entrykey combination by using this statement:
   ON KEY LABEL CTRL+0 *						
The structures of Visual FoxPro screen (.SCX), report (.FRX), and label(.LBX) files differ from the structures of FoxPro 2.6 files. For details onthe structure of Visual FoxPro table files created in the Form, Report, andLabel Designers, please see "Table Structures of Table Files" in the VisualFoxPro Help file. For details on changes made to converted and saved recordfiles, please see "Checking Converted FoxPro 2.6 Reports and Labels" in theVisual FoxPro Help file.

Interface differences

In addition to the changes in the Visual FoxPro interface, such askeystroke, menu, and tool differences, you might want to know about changesto screens, reports, and labels for your own application interfaces.

Keystroke differences

Visual FoxPro redefines some FoxPro version 2.6 navigation keycombinations.
FoxPro 2.6 Key    Visual FoxPro Key     Definition orCombination       Combination           Difference----------------------------------------------------------------------                  Ctrl + N              Create a new fileCtrl + N          Ctrl + Y              Add a record to a Browse windowCtrl + O          Ctrl + E              DO program in edit window				
You can insert null values into null-enabled fields by pressing CTRL+0. Ifyou don't want your users to store null values to variables, disable thiskey combination with the following command:
  ON KEY LABEL Ctrl+0 *						
In Visual FoxPro, you press the TAB key to navigate between controls, soyou cannot tab through options in a list box. Use the arrow keys instead.

Menu differences

Visual FoxPro displays only menus with active options. Some menu items havemoved to different locations in Visual FoxPro. For more information onVisual FoxPro menus, please see "System Menu Names" in the Visual FoxProHelp file.
FoxPro 2.6 menu command          Visual FoxPro menu command-------------------------------------------------------------------1 1/2 Space (Text Menu)          1 1/2 Space (Format Menu)Append (Record Menu)             Append Records (Table Menu)Append From (Database Menu)      Import (File Menu)Beautify (Program Menu)          Documenting Wizard (Tools Menu)                                 professional Edition onlyFoxDoc (Program Menu)            Documenting Wizard (Tools Menu)                                 Professional Edition onlyBrowse (Record Menu)             Browse (View Menu)Change Links  (Edit Menu)        Links (Edit Menu)Copy To (Database Menu)          Export (File Menu)Debug (Program Menu)             Debug Window (Tools Menu)Delete (Record Menu)             Delete Records (Table Menu)Double Space (Text Menu)         Double Space (Format Menu)Enlarge (Text Menu)              Enlarge (Format Menu)Find Again (Edit Menu)           Find (Edit Menu)Replace and Find                 Replace (Edit Menu)Again (Edit Menu),Replace All (Edit Menu)Font (Text Menu)                 Font (Format Menu)Generate (Program Menu)          Visual FoxPro generates only menus.Goto (Record Menu)               Go To Record (Table Menu)Indent (Text Menu)               Indent (Format Menu)Label  (Database Menu)           Print (File Menu)Locate (Record Menu)             Locate Record (Table Menu)Macros (Program Menu)            Macros (Tools Menu)Pack (Database Menu)             Remove Deleted Records (Database Menu)Printer Setup (File Menu)        Page Setup (File Menu)Recall (Record Menu)             Recall Records (Table Menu)Reduce (Text Menu)               Reduce (Format Menu)Reindex (Database Menu)          Rebuild Indexes (Table Menu)                                 Rebuild Indexes (Database Menu)Replace (Record Menu)            Replace Records (Table Menu)Report (Database Menu)           Print (File Menu)Label (Database Menu)Single Space (Text Menu)         Single Space (Format Menu)Spelling (Text Menu)             Spelling (Tools Menu)Trace (Program Menu)             Trace Window (Tools Menu)Undent (Text Menu)               Remove Indent (Format Menu)				

Tool differences

Some FoxPro 2.6 tools have new names and functionality in Visual FoxPro.For more information on Visual FoxPro designers, please see "UsingDesigners" in the Visual FoxPro Help file.
FoxPro 2.6 tool          Visual FoxPro tool-----------------------------------------------Catalog Manager          Project ManagerProject Manager          Project ManagerScreen Builder           Form DesignerAlign (Object menu)      Layout toolboxScreen Builder Toolbox   Form Controls toolboxControl dialogs and      Properties windowscreen layout dialogsMenu Builder             Menu DesignerRQBE                     Query DesignerReport Writer            Report DesignerLabel Designer           Label DesignerView window options      Tools Menu itemsTransporter              Conversion Options dialog boxBrowse window            Grid Control				

Screen differences

You can run unconverted FoxPro version 2.6 screen (.SPR) files in VisualFoxPro. Visual FoxPro forms use code in events and methods and propertysettings instead of code snippets.
                                  Visual FoxPro property,FoxPro 2.6 screen feature         method, or event------------------------------    ---------------------------------#DEFINE, #INSERT preprocessor     Global include file called by newstatements                        .SPR file. (See "Checking the .SPR File"                                  in the Visual FoxPro Help file.)#Section 1 Setup code             Form set Load event#Section 2 Setup code             Form Load eventCleanup code except procedures    Unload eventCode snippets                     Method and event code and propertiesConstants                         Resolved only in method and event code                                  (See "Checking the .SPR File" in the                                  Visual FoxPro Help file.)Macro substitutions               Unresolved in properties. Use variables                                  instead (See "Checking Converted FoxPro                                  2.6 Screens" in the Visual FoxPro Help                                  file.)READ                              WindowType property				
For more details on changing screen code in forms, see "LanguageDifferences" or "Checking Code After Conversion" in the Visual FoxPro Helpfile.

Report and label differences

You can use unconverted FoxPro version 2.6 reports and labels in VisualFoxPro but Visual FoxPro reports and labels enable you to set and controlthe data environment and to control report content through reportvariables.
FoxPro 2.6 report                  Visual FoxPro reportor label feature                   or label feature------------------------------------------------------------------------Controls generated with the        Might need adjustment in Visual FoxProReport Wizard using "PositionRelative To" optionsMemo field size                    Now 4 bytes. (See "Memo field type" in                                   the Visual FoxPro Help file)REPORT TO FILE                     REPORT TO FILE ASCII creates simple                                   text fileREPORT ENVIRONMENTLABEL            Data Environment (View Menu)ENVIRONMENT                        (See "Setting Report and Data Sources"                                   and "Controlling a Report's Data                                   Sources" in the Visual FoxPro Help file)				
For more information on Visual FoxPro reports and labels, please see the"Report Designer" topic in the Visual FoxPro Help file.

Article ID: 129976 - Last Review: 12/04/2015 11:21:23 - Revision: 3.1

Microsoft Visual FoxPro 3.0 Standard Edition, Microsoft Visual FoxPro 3.0b for Macintosh, Microsoft Visual FoxPro 5.0 Standard Edition, Microsoft Visual FoxPro 6.0 Professional Edition

  • kbnosurvey kbarchive kbinfo kbinterop KB129976