The WordStar Resource Site Home Page  
WordStar for Windows Home Page
     
  Home    WS Emulator    WS DOS     WSWin   WS Forums   WS File Conversion    Buy WS    WS History 

 

WordStar for Windows 2.0


WordStar 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:

http://www.wordstar.org/support/downloads/wswin/y2k/WSWINPAT.COM

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:

  1. Insert date immediately in short date format
  2. Insert date immediately in long date format
  3. Prompt user for date format to use (short/long/custom)

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
' DateFormat% = 2 ' Long date format
DateFormat% = 3 ' Use dialog to choose

Here option 3 (Use dialog to choose) is active.

DateFormat% = 1 ' Short date format
' DateFormat% = 2 ' Long date format
' DateFormat% = 3 ' Use dialog to choose

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
DateFormat% = 2 ' Long date format
DateFormat% = 3 ' Use dialog to choose

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"
' CustomDate$ = "dddd, dd MMMM 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"
CustomDate$ = "dddd, dd MMMM 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"
CustomDate$ = "ddd, 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
Ordinal% = 0 ' Use normal dates - number only

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
CONST Rollover% = 80 ' 1900 to 2000 year rollover date

Windows Date Pictures

Picture Item Format
M Month 1-12
MM Month 01-12
MMM Month Jan-Dec
MMMM Month January-December
d Day 1-31
dd Day 01-31
ddd Day Mon-Sun
dddd Day Monday-Sunday
yy Year 00-99
yyyy Year 1900-2040 (Windows 3.0 range)

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:

  1. Fixed single digit day numbers displaying as the letter 'd' (from the date picture) on some systems.
  2. Fixed problem of custom date format input box not being accessible in Windows 3.x. This could be video driver related and may need further tweaks in the future.
  3. Fixed problem of day name being one too low and program abort if day name required and day equal to Sunday.

The following new features have been added:

  1. Added ALT+C quick access key to custom date format input box.
  2. Added additional option to auto-fill custom date input box with a default date format, thus giving three default formats (System long & short, plus the new default) other formats can still be entered when the program runs.
  3. Added default setting for use of normal or ordinal dates to save having to select ordinal every time a date is inserted if this is the user's normal requirement.
  4. Added extra notes in user configuration section at start of program to improve clarity.

Known outstanding issues:

  1. The use of quote marks around the date picture in win.ini will cause these marks to be inserted. The solution is to remove them from the date picture in win.ini.
  2. The use of text strings other than for date formatting allows the text to be inserted. However, the use of the letters d, m, or y, will insert parts of the date in their place. Avoid using any text other than that required for the date formatting itself within win.ini or the Custom date Format input text box.

TOP



Copyright © 1999-2004 Michael Petrie, United Kingdom.


 

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.DLL
Q1029: WordStar for Windows 2.0 Correction to Insert Date as Text Error
Q1033: Y2K Advanced Insert Date as Text Program Description and Screen Shot
Q1035: Assign a Macro to a Toolbutton
Q1036: Assign a Macro to a Keyboard Command

Download Y2K Date Insertion Program (10Kb)

Do you use the WordStar keystroke
set in WordStar for Windows?

Do you have to use Microsoft Word 97 or later?

If the answer to both these questions is YES you NEED the WordStar Command Emulator for Word

Only $34.99

BUY IT NOW!

Buy the WordStar Command Emulator Now!