Re: Y2K and forms
Posted in 1998
Gabbard, Mike W. wrote: > > 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 Yes, but this could get messy trying to reproduce the way the date fields can understand various date formats. I suppose the last four characters would always be the year, though, so it might work. Is there some reason why you cannot accept that users may type 2-digit years and then check the date for sanity in the code? This would not work with dates spanning more than 100 years or so, of course. -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 --- If all else fails, read the instructions AND the release notes. All opinions are my own and not those of Bayer plc. My Internet plumbing does not allow me to mail and post news together. Sorry. --- Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/