Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with dates

Status
Not open for further replies.

wlkh

Technical User
Apr 1, 2001
1
SG
Hi, I have a macro in Lotus 123 Rel 5 that shows the following:

{Get-number "Enter date in 01/01/2001 format";A1}

When I run above in Lotus 123 R5, it displays 01/01/2001 (as keyed in by user) in A1. However, when I run the same in Lotus 97, it becomes "*******" in A1. (Note: cell is set in date format and column is big enough) How do I fix the date in Lotus 97. Thanks
 
wlkh,

I don't use Lotus 123-97, but if I'm not mistaken it uses Lotus Script versus the use of Lotus 123 Macros in the earlier versions. This may be the root of your problem. Perhaps someone else can shed more light on your concern.

Hope this helps.
 
wlkh

One messy way to get around the date problem would be to enter the date as a label then to convert it using @datevalue as follows

{Get-label "Enter date in 01/01/2001 format";A1}
{Let a1,@DATEVALUE(+A1)}

It seems to work OK in rel 9, but is not very elegant to say the least.
 

Another option: If you want to retain the "EXTREMELY EASY" functionality of "macros" (which I refer to as the "SNAP" (Super Natural Application Programming) language, you could use the following:

If you know your dates will ALWAYS be 2000 or beyond, and if you want to SIMPLIFY the data-entry process for the user (short is faster), then the following routine will definitely be worth considering. I suggest you try it, and see that it requires the user to simply enter the MONTH, DAY, YEAR and enter only 1 digit where applicable - i.e. < 10.

Thus, instead of forcing the user to type &quot;01/01/2001&quot; (TEN characters), the user ONLY has to enter THREE characters (SIX if you count the <ENTER> key after each entry. But, it IS shorter and simpler.

This routine ALSO permits the use of the routine in any cell, wherein the cell will automatically be formatted with the date format.

This routine requires that you simply create Range Names for Month (mo), Day (da), and YEAR (yr). Place these &quot;Range Named cells&quot; in an &quot;out-of-the-way place&quot; ...probably on a separate sheet where you have other macro code which the user cannot tamper with.

{Get-number &quot;Enter MONTH (as 1 or 2 digits)&quot;;mo}
{Get-number &quot;Enter DAY (as 1 or 2 digits)&quot;;da}
{Get-number &quot;Enter YEAR (as 1 or 2 digits)&quot;;yr}
{LET @CELLPOINTER(&quot;address&quot;),@DATE(yr+2000,mo,da)}
/RFD4~~

In my opinion, IBM made a HUGE mistake in adopting Microsoft's Visual Basic (which they call Lotus Script). I have experienced first hand, graduates of computer science courses who spend CONSIDERABLY more time in attempting to re-create applications using Visual Basic. Visual Basic proponents usually compare it to being so much easier than using &quot;C&quot;. However, put simply, Lotus 123's macro (&quot;SNAP&quot;) language is to Visual Basic what Visual Basic is to &quot;C&quot;.

Lotus/IBM was on the verge of making a TREMENDOUS BREAK-THROUGH in RE-ESTABLISHING Lotus 123 as THE PREMIERE Application Development Software Product in the World. They only had to &quot;team up&quot; with another product which is DESPERATELY REQUIRED in the spreadsheet application development world - a COMPILER. This COMPILER ALREADY exists in the form of a product called &quot;VISUAL BALER&quot; (not to be confused with Visual BASIC).

Visual BALER was a WONDERFUL product as a DOS-based product, but in attempting to convert to a Windows-based product, ran out of resources. They did produce a Windows-based product (called Visual Baler version 2.5) but it is too full of bugs to be worthwhile. This was therefore a GOLDEN opportunity for Lotus/IBM - AND STILL IS - for them to purchase the rights to Visual BALER, and to incorporate this LONG-AWAITED COMPILER into a NEW RELEASE of Lotus 123.

I hope you find the example code useful, as well as my comments informative.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
This problem does not appear in a Windows 98 environment. However, this problem does appear in Windows XP environment. Have attempted to structure XP to run Lotus 97 in a Win 98 environment but program will not start. So far easiest and fastest way to solve date problem is to simply enter the year as a 4-digit number.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top