Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Function to return a valid date
Message
De
08/11/2001 08:05:15
 
 
À
08/11/2001 07:53:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00578964
Message ID:
00578981
Vues:
21
Dimitris,
I think you have to setup an error trap:
lcOnError = ON("ERROR")
ON ERROR STORE .t. TO llError
xx = "20011101"
ldDate = date(val(left(xx, 4)), val(substr(xx,5,2)), val(right(xx,2)))
ON ERROR &lcOnError

RETURN NOT llError
HTH
>You mean
>xx = "20011101"
>?date(val(left(xx, 4)), val(substr(xx,5,2)), val(right(xx,2)))
>aerror(ff) e.t.c. ?
>
>dim
>
>>>Hello friends,
>>>
>>>I would like to ask whether there is a way (function or something) which can determine that a specific string contains a valid date for instance :
>>>isvaliddate("20011101") would return .t.
>>>
>>>Thank you
>>>Dimitris
>>
>>Convert to a date with the date(year, month, day) function. Before VFP6, you have to use dtoc() instead.
>>
>>Trap for errors.
>>
>>HTH, Hilmar.
Daniel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform