Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DATETIME() Coding in VFP5.0
Message
De
23/02/1997 13:37:20
Linda Morgan
Garden City Community College
Garden City, Kansas, États-Unis
 
 
À
23/02/1997 13:33:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00021683
Message ID:
00021698
Vues:
42
>>>>Can anyone tell me why the following code used to work (under VFP50) and now, all of a sudden, gives me an error message "Operator/operandi mismatch" ? The underlying field is formatted for datetime and I haven't changed anything else (that I'm aware of) to cause this sudden refusal to work syndrome! Century is set on. Thanks in advance.
>>>>
>>>>IF !EMPTY(THIS.Value) < DATETIME()
>>>> = MESSAGEBOX("You need to enter a VALID date or time",1,"ERROR MESSAGE")
>>>> RETURN .F.
>>>> ELSE
>>>> RETURN .T.
>>>>ENDIF
>>>
>>>It's not related to the field but to This.Value.
>>Does that mean that I need the Character to Date converter as in
>>IF !EMPTY(CTOT(This.value) < DATETIME() ???
>>I really need to validate this data.
>>
>>Thanks - Linda
>
>You need 2 tests:
>
>
>If EMPTY(This.value))
> * Your message here
> return .f.
>endif
>if This.value > datetime()
> * Your message here
> return .f.
>endif
>return .t.
>
>
>Vlad

Thanks All . . I'll bet I did add that !Empty() after. Thanks for the advice and two part valid check code, Vlad.

Linda
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform