|
|
|||||||||||||||||||||||||||||||||||||
|
WordStar for Windows 2.0WordStar for Windows Date Insertion Macro Program Version 1.4 Release Notes Introduction This program overcomes WordStar for Windows' insistance on inserting a date in the 1900's. Dates in years after 1999 will be inserted as 19xx, or in short date format with single digit year numbers as " y", i.e., there will be a leading space. This program overcomes those problems by inserting the date as fixed text using the formatting set in the Windows Control Panel's regional Settings. The program cannot insert or correct for the WordStar for Windows problem of date merge variables which suffer the same Y2K problem outlined above. However there is a patch for WSWIN.DLL that corrects all of these except the missing leading zero for year numbers less than 10 if short date formats are used (it is recommended to use four digit year numbers in most cases, which will prevent this problem from occuring. The patch is available from the WordStar Resource Site downloads section:
This program overcomes the remaining problem of missing leading zeros if short date formats are a must. However it can only correct this for fixed text in the document and not as a date variable. With the Y2K patch available for WSWIN.DLL this program is of less importance; however, the Y2K patch hasn't been tested on all WSWin language versions and so may not be useable in all cases. There are other reasons for using the program though, the main one being that it gives a quick way to insert customised date formats into the document. To this end several enhancements have been added. These are explained in the version 1.4 update details below. Program Options (1) - Modes To allow maximum flexibility the program allows three modes of operation:
These options are set by commenting/uncommenting a DateFormat% option in lines 97, 98, and 99 of the program. This can be done in the Macro Editor, or any other text editor. To disable an option add an apostrophe at the start of the line. To enable an option, remove the apostrophe. For example: ' DateFormat% = 1 ' Short date format Here option 3 (Use dialog to choose) is active. DateFormat% = 1 ' Short date format Here, the Short date format option is active. Be sure to comment options following the one you want as multiple uncommented options will give you the last one in the list, as follows: DateFormat% = 1 ' Short date format Here all three options are uncommented. The program will use the last - the Use dialog option. Why would you want these options? You may not, and the default option 3 will perhaps suit you. However, if you want to assign a shortcut command or a tool button to a short date insert then you need to set the option to do just that or you'll have to answer the dialog every time. If you want multiple options, so you can have three shortcuts, or toolbar buttons, then you need to save three copies of this program. Leave the original as it is and assign that to the choose date format. Save another copy as shrtdate.wmc and assign that to your short date toolbar button. Save the third copy as longdate.wmc and assign that to your long date toolbar button. In the shrtdate and longdate versions you'll have to change the DateFormat% option to suit the function. Program Options (2) - Default Custom Date Format If you have the program set to option 3 (see above) and therefore to allow you to enter a customised date format picture rather than use your default Windows long or short date formats, you can set the program up to offer a third format by default. If you don't want this format when it's offered you can just overtype it with a different date format picture. The default Custom date Format picture is filled in to the Custom Date Format input box on the program's date dialog ready for you to just click on OK. If you choose not to use this option you will be presented with a blank Custom date Format input box ready for you to enter any format of your choosing. By default the program does not offer this default custom date format, so if you require this function you will need to turn it on and to set the default custom date format you want as your default. Both tasks are easily achieved as follows: To turn on the default custom date format option you need to uncomment the CustomDate$ line that starts on line 112 of the program. There are two lines provided as examples within the program. ' CustomDate$ = "dddd, MMMM d, yyyy" For example, if you want this facility you would delete the second line's apostrophe to achieve the following: ' CustomDate$ = "dddd, MMMM d, yyyy" This would fill in the Custom date Format input box with a date format picture of dddd, dd MMMM yyyy. If you want a different default you need to edit the line to match the format you require. You must maintain the double quote marks around the format picture, which must comply with the formatting options described below. For example, to use a default format of "Wed, January 31, 2001" you would modify the lines to read as follows: ' CustomDate$ = "dddd, MMMM d, yyyy" Note that if you normally want ordinal dates (1st, 2nd, etc.), so you will also need to set the default ordinal date option, explained below. Program Options (3) - Ordinal Dates Ordinal dates (1st, 2nd, 3rd, 4th, etc.) can be inserted automatically by the program for long date formats that have the day format picture set to display day numbers as 1-31. Ordinal date formats are not appropriate for day numbers displayed as 01-31 and so this is disabled automatically. To use ordinal dates, the option can be selected when the program runs, but if you always need this format you would have to check this option every time you inserted a date. To overcome this there is a default option that presets the check box for the dialog box operation mode, but also uses this for the system long date format. By default this option is set to not use ordinal dates. But this can be changed by adding an apostrophe to the start of the Ordinal% = 0 line shown below and removing the apostrophe from the line 'Ordinal% = 1. These lines are at line 134 and 135 in the program. If both options are set the same non-ordinal dates will be used. 'Ordinal% = 1 ' Use ordinal dates Program Options (4) - Century Rollover Year There is an option to chenge the century rollover year for PCs that aren't Y2K compliant. By default the program will treat any year number greater than 80 as being in the 1900's, and anything less as being in the 2000's. This 'rollover' year can be changed on line 122 of the program by modifying the number that follows CONST Rollover% =. The actual line is shown below: ' Program uses system date, but add rollover just in case Windows Date Pictures
Pictures can be combined in any order. Seperating punctuation limited to (,.:;/ and space, unless enclosed in quotation marks) Note, this program does not check punctuation - it is displayed literally! Changes Between Version 1.0 and 1.1 (19 Jan 2000) Version 1.0 always assumed a date seperator character of a single space between each part of a long date format date. Version 1.1 checks the users date formatting string in win.ini for non-date specifying characters and uses these to seperate the date parts of the inserted date text. Changes Between Version 1.0 and 1.2 (6 Feb 2000) Previous versions didn't allow for day names to be included in the long date format. This has been corrected. The method of extracting the seperating characters between different parts of the date has also been changed. Note, that the specification for the Windows 3.0 win.ini file states that date part seperating punctuation should be surrounded by quote marks. This should not be necessary unless text strings are to be included (other than normal date seperators - ,.:;/ and space). The program does not check for other strings, and is limited to a maximum date picture length of 20 characters. These 'date pictures' are made up as shown above. Changes Between Version 1.0 and 1.3 (7 Feb 2000) Expanded the date insertion dialog to allow manual 'on-line' alternative date formats to be entered. These are typed into a text box (the option to select from a dropdown list was rejected as a bug in WSWin stops the combobox from returning manually entered date formats - you're stuck with the list, and adding a combo and a text box would have made operation too confusing - If you want this facility, let me know and I can add it). Also added a checkbox that will cause automatic addition of ordinal number suffixes to date formats that use a 1-31 style day number. Changes Between Version 1.0 and 1.4 (29 Jan 2001) This release corrects several problems, as follows:
The following new features have been added:
Known outstanding issues:
|
|
FAQ: Q1034 See also:Q1027: WordStar for Windows 2.0 Y2K Corrected Template Macro (template.wmc)Q1028: WordStar for Windows 2.0 Y2K patch for WSWIN.DLLQ1029: WordStar for Windows 2.0 Correction to Insert Date as Text ErrorQ1033: Y2K Advanced Insert Date as Text Program Description and Screen ShotQ1035: Assign a Macro to a ToolbuttonQ1036: Assign a Macro to a Keyboard CommandDownload Y2K Date Insertion Program (10Kb)
|
|||||||||||||||||||||||||||||||||||