RE: Y2K and forms
Posted in 1998
Hi John, The easiest way that I can think of is define the a second variable date variable as CHAR(10). In the INPUT statement use the char date variable instead of the original date variable. Then on the AFTER FIELD check the length of the char date variable, you can do other various syntax easily with a char field. If invalid length return to the field and have them re-enter date. If valid length set the original variable equal to the char date variable. Mike -----Original Message----- From: rregepj@aol.com [mailto:rregepj@aol.com] Sent: Tuesday, September 15, 1998 9:09 PM To: informix-list@iiug.org Subject: Y2K and forms HELP! Can any one tell me how to force a user to enter a four digit year into a date variable? ODS 7.2x i4GL 6.x A picture clause of "##/##/###" only requires that the year portion is numeric. Format "mm/dd/yyyy" only works on display. And used with default = TODAY doesn't guarantee that the user will type four digits in the year. Resorting to i4GL code with an after field clause doesn't help either since the engine has already put the assumed century in the variable by the time you get there. We do not want to recode everything to use characters then convert. The first premise that we started with when dealing with Y2K was to remove all ambiguity whereever possible first. So we thought we would start with requiring that users key in all 4 digits, we thought this would be simply done with a picture clause in the .per. Any help will be much appreciated. Thanks! -- John Regep rregepj@aol.com