Information générale
Titre:
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?
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement