Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Time class
Message
 
 
To
24/05/2006 11:58:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01110350
Message ID:
01124558
Views:
15
John,

I think after spending some time on the class I was unable to fix it and abandoned the whole class idea.

Thanks again.

>Feel free to post the class with the changes as a new file or however you wish.
>
>John
>
>>Hi John,
>>
>>I've downloaded your time class and quickly tried it. It looks good, but when I highlight the whole entry to delete and re-type, it doesn't work. I think KeyPress method should be adjusted for Del and Backspace codes.
>>
>>
>>*:*
>>*:* Check the position of the cursor and test versus accepted range.  If not, lNoDef is set
>>*:* and the keypress is ignored via NODEFAULT
>>*:*
>>LPARAMETERS nKeyCode, nShiftAltCtrl
>>LOCAL lNoDef
>>lNoDef=.F.
>>DO CASE
>>CASE THIS.SelStart=0
>>   IF !(CHR(nKeyCode) $ "01")
>>      lNoDef=.T.
>>   ENDIF
>>CASE THIS.SelStart=1 OR THIS.SelStart=4 OR (THIS.SelStart=7 AND !THIS.ShowSeconds)
>>   IF !(CHR(nKeyCode) $ "0123456789")
>>      lNoDef=.T.
>>   ENDIF
>>CASE THIS.SelStart=3 OR (THIS.SelStart=6 AND !THIS.ShowSeconds)
>>   IF !(CHR(nKeyCode) $ "012345")
>>      lNoDef=.T.
>>   ENDIF
>>CASE (THIS.SelStart=6 AND !THIS.ShowSeconds) OR (THIS.SelStart=9 AND THIS.ShowSeconds)
>>   IF !(UPPER(CHR(nKeyCode)) $ "AP")
>>      lNoDef=.T.
>>   ENDIF
>>ENDCASE
>>IF lNoDef
>>   NODEFAULT
>>ENDIF
>>
>>Do you or anyone already made the adjustments, so I don't have to re-invent the wheel?
>>
>>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform