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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get date question 1

Status
Not open for further replies.

DeadIslets

Programmer
Apr 3, 2002
45
US
I am prompting the user to input a date with a 4-digit year. I have 'Set Century On' and my statement looks like the following:

@4,0 Say "Date of Service" Get tDOS Picture "99/99/9999"

However when the Get receives focus it prompts for the date with a 2-digit year, i.e. "99/99/99" I thought the Picture clause would take of this but evidently not. I am probably missing something obvious. Thanks for your help folks.

-Keith.
 
All you need is the set century...

Try this code
Code:
set century on
set date british
mdate = date()
clear
@ 10,10 say "Date " get mdate
read

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Griff, thanks for the response, your example runs perfectly.

In my code I already had 'Set Century On' so I added 'Set Date American' (even though this is the default). Again the initial date displays perfectly (99/99/9999), but when the Get receives focus it displays the date in the '99/99/99' format.

Thanks,

-Keith
 
If the example works, I would make sure the 'set date' was immediately prior to the 'get' and I would also make sure that (in your case) the variable being sought was of a date type - is there any chance it is actually a string?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Griff, thanks for your promptings. Problem found.

I have 25 'Get's before the 'Read' is invoked. Down towards the bottom of the getlist there is a 'Set Century Off' statement. When I removed this my initial Date 'Get' worked fine. Moral of the story is you can't mix 'Set Century' in the middle of a getlist.

Thanks again for your help.

-Keith
 
Happy to help.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Jim, probably not. I haven't been in this code for along time. (Probably why I'm rusty at Clipper.) It was exhibiting some peculiar behavior so I'm going to leave Century On entirely for a while. Will probably turn it all off later and leave it that way.

Thanks,

-Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top