Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Year 0000
Message
De
15/04/2005 02:54:54
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01003937
Message ID:
01005000
Vues:
25
>>>I make it to work, thanks again: Do you see any problems here?
>>
>>No with ControlSource set;
>>Only a simplified version ( with my style )
>>
>>LOCAL llError
>>DO case
>>CASE EMPTY(m.this.Value)
>>	local lcText
>>	lcText = strtran(m.this.text,"AM","")
>>	lcText = strtran(m.lcText,"PM","")
>>	lcText = strtran(m.lcText,"M","")
>>
>>	if !empty(chrtran(m.lcText,"/.:-","    "))
>>		****************************************
>>		* I'm not sure that you can  run here
>>		****************************************
>>		
>>		*This.Value=CTOD("^"+STR(YEAR(DATE()),4)+"-"+STR(MONTH(DATE()),2)+"-"+LEFT(This.Text,2))
>>		=ErrorMsg('Please enter a valid date',0+16,"Error in date entry")
>>        llError = .t.
>>	endif
>>
>>case m.this.value < m.this.dRangeLowBound
>>	=ErrorMsg('Please enter a correct year',0+16,"Error in date entry")
>>	llError = .t.
>>endcase
>>
>>return IIF(m.llError, m.this.dRangeLowBound, {}) && so it would work for empty dates
>
>I found later one minor bug, which I fixed in the latest version of the code. This code works for date type, but returns data type mismatch error for datetime. So I return either date or datetime value depending on the type of the value.
return IIF(m.llError, m.this.dRangeLowBound, NULL) && so it would work for empty dates/datetimes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform