Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Entering invalid dates
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00514752
Message ID:
00515080
Views:
13
>>>>>isblank(ctod(allt(.Text1.Value)))
>>>>>
>>>>>this will return .T. if the date invalid ( according to VFP ).
>>>>>
>>>>>- jer
>>>>
>>>>But if the date is valid, this gives an error.
>>>
>>>what version are you running...I just tried to make this through and error and is wouldn't.
>>>
>>>isblank(ctod(allt("2001/12/02"))) = .T.
>>>isblank(ctod(allt("02/12/2001"))) = .F.
>>>isblank(ctod(allt("blablablaa"))) = .T.
>>>isblank(ctod(allt("06-12-2001"))) = .F.
>>>isblank(ctod(allt("06-45-2001"))) = .T.
>>
>>The problem lies in the fact that if the date is valid, the value of the textbox will be a date type. So it's like doing isblank(ctod(allt({06/05/2001}))), which gives an error.
>
>Instead of value try text property.

I just created a quick test form, which seems to work: in textbox valid I put this code:
=messagebox(this.text)
if isblank(ctod(this.text))
=messagebox("Entered invalid date"))
endif
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform