Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mensagem de erro em TextBox = Data
Message
De
21/12/2004 12:29:35
 
 
À
21/12/2004 11:08:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00970955
Message ID:
00971055
Vues:
19
>Sei que 21/12/204 é uma data inválida. O caso é que quando esta data é digitada em um TextBox o Fox gera o erro que mencionei. Queria que o Fox não executasse esta validação de data. Já fiz outros sistemas e nenhum deles aparecia esta mensagem nestas circunstâncias. Passei o Set Strictdate para 0 e a menssagem persiste.
>
>O que faço?


Ok. Não ficó claro.
Nesse casso vc pode validar (no txtBox.valid por ex.) que a data é válida antes de passar a data para o programa/tabela.

Algo assim como:
* ou usar ON ERROR pre-VFP8
local llError, xx, lcTmpData
lcTmpData = This.Value
try
  xx = date(Val(Substr(lcTmpData,7)), Val(Substr(lcTmpData,4,2)), val(Left(lcTmpData,2)))
catch
  llError = .T.
endtry
if llError
  * data inválida
  return .F.
endif


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform