Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining keyboard Buffer contents / variable contents
Message
From
16/01/1997 11:32:15
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
Determining keyboard Buffer contents / variable contents
Miscellaneous
Thread ID:
00017537
Message ID:
00017537
Views:
116
Description of Problem:

Determine if the user typed a two digits or four digits as a year in a date variable. By the time I get the result (in the variable VALID) FoxPro already has value for century, of course.

EXAMPLE SOLUTION
@ 0,0 get theDate valid didTheyJustType2(@theDate)
read

function didTheyJustType2
param thedate
CredibilityofFoxPro=.T.
if just2YearDigits(theDate)
theDate=rightCenturyandDate(theDate)
else
CredibilityofFoxPro=.f.
endif

return CredibilityofFoxPro


Environmental Conditions/Assumptions:
Set century is on.
Variable is of type date

Misc:
I thought I read somewhere where the contents of the keyboard buffer could be determines (all, not just some characters) Maybe I was dreaming, or maybe I was reading the Delphi manual <g>

Other Solutions:
I can approximate READ with inkey(), (nope)
I can use a string variable, then convert it. (likely)
Move to numerous modern platforms/versions...

Any brilliant ideas?
Reply
Map
View

Click here to load this message in the networking platform