Upgrading to DataFlex 3.2: Difference between revisions
m
Added note about the DataFlex debugger
Hsymington (talk | contribs) m (→Converting Data Files to the Current Revision: Corrected numbering on a list) |
Hsymington (talk | contribs) m (Added note about the DataFlex debugger) |
||
(10 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
The content of this page is based on a whitepaper originally written in May 1998 by Dennis Piccioni from Data Access Worldwide. Updates were made to the content up until 2002, but nothing after that, so some references will be dated. | The content of this page is based on a whitepaper originally written in May 1998 by Dennis Piccioni from Data Access Worldwide. Updates were made to the content up until 2002, but nothing after that, so some references will be dated. | ||
'''Note:''' One very good reason to upgrade is that if you are using DataFlex 3.2, you can use the '''[https://docs.google.com/document/d/1a7DOX7bULiEqAkNXmKA-T91n0RfLFzh8V-CjXwMW0x0/edit#heading=h.mxjauxfaio71 DataFlex Debugger]''' to run your programs in debug mode with features such as single stepping, variable inspection, call stack and record buffer inspection. Read the help and get the DataFlex Debugger download, from the [https://www.dataaccess.eu/resources/downloads/download-category/download-subcategory-842?dagapsg=64 DataFlex Debugger download page]. | |||
== Why Upgrade? == | == Why Upgrade? == | ||
Line 187: | Line 190: | ||
== Upgrading Source Code to DataFlex 3.2 == | == Upgrading Source Code to DataFlex 3.2 == | ||
Properly written source code from prior revisions of DataFlex is fully compatible with revision 3.2 and should compile and operate without problem. The DataFlex 2.3 compiler and runtime were not as strict as the newer versions. In some cases, improper code was allowed to compile and/or run under DataFlex 2.3b, but will generate compiler or runtime errors when used with a newer revision of DataFlex | Properly written source code from prior revisions of DataFlex is fully compatible with revision 3.2 and should compile and operate without problem. The DataFlex 2.3 compiler and runtime were not as strict as the newer versions. In some cases, improper code was allowed to compile and/or run under DataFlex 2.3b, but will generate compiler or runtime errors when used with a newer revision of DataFlex. | ||
== Troubleshooting DataFlex 3.2 == | == Troubleshooting DataFlex 3.2 == | ||
Line 223: | Line 226: | ||
Here are some batch file examples for easy switching between versions of DataFlex. These batch files will run only on DOS-based operating systems or in DOS sessions under Windows. | Here are some batch file examples for easy switching between versions of DataFlex. These batch files will run only on DOS-based operating systems or in DOS sessions under Windows. | ||
Many programmers, as well as end users, run multiple versions of DataFlex and use batch files to switch from version to version | Many programmers, as well as end users, run multiple versions of DataFlex and use batch files to switch from version to version. | ||
Following are some batch file examples for switching among versions. You’ll want to place these batch files in a directory that is included in your PATH environment variable (e.g. use a directory c:\batch to be included in your PATH, to contain all batch files). | Following are some batch file examples for switching among versions. You’ll want to place these batch files in a directory that is included in your PATH environment variable (e.g. use a directory c:\batch to be included in your PATH, to contain all batch files). | ||
Line 254: | Line 257: | ||
Note: The DFPROG environment variable is used by DataFlex revisions 2.3 and 3.01 to find the location of its executable files (i.e. dfrun.exe). | Note: The DFPROG environment variable is used by DataFlex revisions 2.3 and 3.01 to find the location of its executable files (i.e. dfrun.exe). | ||
== Creating Shortcuts for Running DataFlex on Windows == | == Creating Shortcuts for Running DataFlex on Windows == | ||
Line 296: | Line 297: | ||
2. The Menu Program (menu.flx) | 2. The Menu Program (menu.flx) | ||
DataFlex 3.2 comes with | DataFlex 3.2 comes with an object-oriented, [[#CUA]] compliant menu program. This is the default menu that will run with DataFlex 3.2. | ||
If you wish to use a menu program that more closely resembles the 2.3b style menu program, you can compile menuold.src (\df32\src\source\menuold.src) and then either execute "dfrun menuold" to access this menu or rename menuold.flx to menu.flx to have this menu be used as the default. | If you wish to use a menu program that more closely resembles the 2.3b style menu program, you can compile menuold.src (\df32\src\source\menuold.src) and then either execute "dfrun menuold" to access this menu or rename menuold.flx to menu.flx to have this menu be used as the default. | ||
Note: Do not compile and/or run the 2.3b menu.src in DataFlex 3.2. This will not work, which is why menuold.src was provided with DataFlex 3.2. | Note: Do not compile and/or run the 2.3b menu.src in DataFlex 3.2. This will not work, which is why menuold.src was provided with DataFlex 3.2. | ||
Line 413: | Line 414: | ||
'''The -x23 Compiler Flag''' | '''The -x23 Compiler Flag''' | ||
For backward compatibility purposes, | For backward compatibility purposes, the compiler flag -x23 is provided (i.e. "dfcomp source.src -x23") for compiling programs as if they had been compiled in 2.3b. This flag was provided until revision 3.04 to allow time for developers to bring their existing programs up to date. Most of the changes in DataFlex that are outlined in this article and affect existing 2.3 DataFlex code were made to DataFlex with revision 3.0, in about 1990. At some point, a choice must be made between backward compatibility and progress, and as of revision 3.05, the -x23 flag is no longer supported, so you must make the appropriate source code changes to existing DataFlex 2.3 programs. | ||
== Runtime Errors == | == Runtime Errors == | ||
Line 472: | Line 473: | ||
===Error 4098 "Bad Relationship"=== | ===Error 4098 "Bad Relationship"=== | ||
Error encountered by developers upgrading to DataFlex 3.2 or Visual DataFlex. This error will occur at runtime whenever a relationship is found between 2 database fields that are not of exactly the same type and length. Overlap fields are the only exception to this rule; they may relate to either other overlap fields or ASCII fields of the same length. | |||
Note: Many developers using 2.3b used record number relationships, where a field in one database file is related to the RECNUM field in another file. When upgrading to 3.2, suddenly this message appears. This is usually because the "relating from" field was defined as Numeric 6.0, instead of Numeric 8.0, which is the type and length of the RECNUM field. | Note: Many developers using 2.3b used record number relationships, where a field in one database file is related to the RECNUM field in another file. When upgrading to 3.2, suddenly this message appears. This is usually because the "relating from" field was defined as Numeric 6.0, instead of Numeric 8.0, which is the type and length of the RECNUM field. | ||
Line 550: | Line 551: | ||
DataFlex has always been Y2K (Year 2000) capable, meaning that developers have always been able to write Y2K-compliant applications. In prior revisions, such as 2.3b, it was usually up to the developer to ensure data was displayed and saved with 4-digit years, but DataFlex already had the capability to store dates with 4-digit years. This meant creating on-screen and report date images with enough room for 4-digit years, and adding 693975 (the integer equivalent of 01/01/1900) to a 2-digit year, wherever dates were used. | DataFlex has always been Y2K (Year 2000) capable, meaning that developers have always been able to write Y2K-compliant applications. In prior revisions, such as 2.3b, it was usually up to the developer to ensure data was displayed and saved with 4-digit years, but DataFlex already had the capability to store dates with 4-digit years. This meant creating on-screen and report date images with enough room for 4-digit years, and adding 693975 (the integer equivalent of 01/01/1900) to a 2-digit year, wherever dates were used. | ||
In newer revisions of DataFlex (Visual DataFlex, DataFlex 3.2), | In newer revisions of DataFlex (Visual DataFlex, DataFlex 3.2), there is an easier method, both for creating new applications that are Y2K compliant and for updating existing, noncompliant applications to full Y2K compliance. | ||
DataFlex has always had the capability to store dates with 4-digit years, so a properly written DataFlex application in any version of DataFlex will be Year-2000 (Y2K) compliant. However, in DataFlex 3.2 (caution: revisions of DataFlex prior to 3.1c do not have the Y2K-Enhancements), | DataFlex has always had the capability to store dates with 4-digit years, so a properly written DataFlex application in any version of DataFlex will be Year-2000 (Y2K) compliant. However, in DataFlex 3.2 (caution: revisions of DataFlex prior to 3.1c do not have the Y2K-Enhancements), additional support has been implemented for easily making your applications Y2K compliant. | ||
There are numerous additional enhancements and bug fixes to DataFlex 3.2. Please consult the DataFlex 3.2 Readme file for more details on these enhancements and fixes. | There are numerous additional enhancements and bug fixes to DataFlex 3.2. Please consult the DataFlex 3.2 Readme file for more details on these enhancements and fixes. | ||
Line 588: | Line 589: | ||
'''DataFlex 3.2''' | '''DataFlex 3.2''' | ||
In DataFlex 3.2, | In DataFlex 3.2, there is a file called y2k.pkg, which contains the set_Date_Attribute command and default settings for Date4_State (dfTrue), SysDate4_State (dfTrue) and Epoch_Value (30). | ||
To make an existing DataFlex 2.3b program Y2K enhanced, simply add this line to the beginning of your program and recompile the program under DataFlex 3.2: | To make an existing DataFlex 2.3b program Y2K enhanced, simply add this line to the beginning of your program and recompile the program under DataFlex 3.2: | ||
Line 626: | Line 627: | ||
DataFlex 2.3 was designed in simpler days of computing. Hard disks were smaller, less memory was available and applications were generally smaller and did fewer things. Developers usually had relatively few development tools (and revisions thereof) installed on their PCs. Those times have changed. Today, it seems one can never have enough hard disk space or RAM and most applications do a gazillion things, whether they are needed or not. | DataFlex 2.3 was designed in simpler days of computing. Hard disks were smaller, less memory was available and applications were generally smaller and did fewer things. Developers usually had relatively few development tools (and revisions thereof) installed on their PCs. Those times have changed. Today, it seems one can never have enough hard disk space or RAM and most applications do a gazillion things, whether they are needed or not. | ||
For programmers things have changed as well. It is common for application designers to develop with many different tools, even for a single application | For programmers things have changed as well. It is common for application designers to develop with many different tools, even for a single application. | ||
In DataFlex 2.3b, many developers kept the runtime files in the same directory as the application files (i.e. data and .flx files). In order to successfully upgrade to DataFlex 3.2, or to run the two (or more) versions of DataFlex simultaneously, these files need to be separated. Runtime files from the two versions will interfere with each other. | In DataFlex 2.3b, many developers kept the runtime files in the same directory as the application files (i.e. data and .flx files). In order to successfully upgrade to DataFlex 3.2, or to run the two (or more) versions of DataFlex simultaneously, these files need to be separated. Runtime files from the two versions will interfere with each other. | ||
Line 714: | Line 715: | ||
#Make sure c:\df23 is in your PATH environment variable | #Make sure c:\df23 is in your PATH environment variable | ||
#Run DataFlex (dfrun ProgramName, dfcomp, dfquery, etc.) | #Run DataFlex (dfrun ProgramName, dfcomp, dfquery, etc.) | ||
== Appendix A: Directory Listing of a DataFlex 2.3b Development License == | == Appendix A: Directory Listing of a DataFlex 2.3b Development License == |