INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Get date question

Get date question

(OP)
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.  

RE: Get date question

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 Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

RE: Get date question

(OP)
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

RE: Get date question

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 Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

RE: Get date question

(OP)
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

RE: Get date question

Keith,

Do you need to keep flipping CENTURY ON & OFF.

Jim C.
 

RE: Get date question

Happy to help.

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

RE: Get date question

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close