Upgrading to DataFlex 3.2: Difference between revisions

Lines
(Utilities headings)
(Lines)
Line 524: Line 524:
Now a brief discussion of Year 2000 issues. You can find additional information on this issue in the following:
Now a brief discussion of Year 2000 issues. You can find additional information on this issue in the following:


DataFlex and the Year 2000, N. Joe Potts, Data Access Corporation, December 2, 1997.
*DataFlex and the Year 2000, N. Joe Potts, Data Access Corporation, December 2, 1997.
Installation & Environment Guide for all Y2K Enhanced revisions of DataFlex.
*Installation & Environment Guide for all Y2K Enhanced revisions of DataFlex.
Online Documentation for Visual DataFlex (all revisions of VDF).
*Online Documentation for Visual DataFlex (all revisions of VDF).
 
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.


Line 535: Line 536:
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.


Y2K-Enhanced Features
===Y2K-Enhanced Features===


There are common methods used in all of these Y2K-Enhanced revisions:
There are common methods used in all of these Y2K-Enhanced revisions:


Epoch_Value
'''Epoch_Value'''
 
This is a value between 0 and 99 which determines a "cutoff year", which determines at which year 2-digit entered year becomes a 19XX year or a 20XX year.
This is a value between 0 and 99 which determines a "cutoff year", which determines at which year 2-digit entered year becomes a 19XX year or a 20XX year.


For example, if the Epoch_Value is set to 30 (the default):
For example, if the Epoch_Value is set to 30 (the default):


If a user enters "010198" into a date window, it will be converted to "01/01/1998".
*If a user enters "010198" into a date window, it will be converted to "01/01/1998".
If a user enters "010102" into a date window, it will be converted to "01/01/2002".
*If a user enters "010102" into a date window, it will be converted to "01/01/2002".
SysDate4_State
 
'''SysDate4_State'''
 
When turned on, the runtime returns a date with a 4-digit year wherever the sysdate command is used.
When turned on, the runtime returns a date with a 4-digit year wherever the sysdate command is used.


Date4_State
'''Date4_State'''
 
When turned on, this state ensures that whenever a date is displayed or stored, it is automatically converted to a date with a 4-digit year.
When turned on, this state ensures that whenever a date is displayed or stored, it is automatically converted to a date with a 4-digit year.


In character-mode revisions, in date windows with only 2 digits for the date, the LAST 2 digits are displayed:
In character-mode revisions, in date windows with only 2 digits for the date, the LAST 2 digits are displayed:
For example: "09/17/2002" is displayed as "09/17/02"


Conv2000 Utility
*For example: "09/17/2002" is displayed as "09/17/02"
 
===Conv2000 Utility===
This is a DataFlex program that changes all dates in existing data files from 2-digit year dates to 4-digit year dates. This utility does not change the format of any date fields or data files containing date fields, it only changes the content (value) of the date field. The utility can loop through all files on the current filelist or allow you to select a file to convert. Conv2000 is written in DataFlex and all source code for it is provided.
This is a DataFlex program that changes all dates in existing data files from 2-digit year dates to 4-digit year dates. This utility does not change the format of any date fields or data files containing date fields, it only changes the content (value) of the date field. The utility can loop through all files on the current filelist or allow you to select a file to convert. Conv2000 is written in DataFlex and all source code for it is provided.


Implementation of Y2K-Enhanced Features
===Implementation of Y2K-Enhanced Features===
 
'''DataFlex 3.2'''


DataFlex 3.2
In DataFlex 3.2, DAC has provided 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).
In DataFlex 3.2, DAC has provided 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:


Use y2k.pkg
===Use y2k.pkg===


TIP: In DataFlex 2.3b, all images had to be at the very top of the program. In DataFlex 3.2, this is no longer necessary, so you can place code in between images and even before any images at the top of the program. If you have a lot of programs (source files) to which you need to add the "Use y2k.pkg" statement, you could write a small DataFlex program to do this for you. See the DAW Technical Knowledge Base for more information.
TIP: In DataFlex 2.3b, all images had to be at the very top of the program. In DataFlex 3.2, this is no longer necessary, so you can place code in between images and even before any images at the top of the program. If you have a lot of programs (source files) to which you need to add the "Use y2k.pkg" statement, you could write a small DataFlex program to do this for you. See the DAW Technical Knowledge Base for more information.


A Brief Overview of Y2K.pkg
'''A Brief Overview of Y2K.pkg'''


There are only 3 lines of code in y2k.pkg, which turn on all the automatic Year-2000 enhancements in DataFlex. Here is a brief look at each of the 3 lines of code in y2k.pkg:
There are only 3 lines of code in y2k.pkg, which turn on all the automatic Year-2000 enhancements in DataFlex. Here is a brief look at each of the 3 lines of code in y2k.pkg: