General information
Title:
Determining keyboard Buffer contents / variable contents
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only