Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric field for year - detect 00 or no value entered?
Message
 
 
To
11/06/2004 09:13:35
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00912459
Message ID:
00912680
Views:
7
This message has been marked as the solution to the initial question of the thread.
Tracy,

In the Interactive Change only record the fact that "00" was entered or not.
*Interactive Change
* lEntered00 - custom property of textbox
this.lEntered00 = (THIS.TEXT = "00")

*Valid
DO CASE
CASE this.lEntered00
	this.value = ADDCENT(this.value)
CASE EMPTY(this.value)
	this.value=YEAR(DATE())
ENDCASE
...
>Thanks for the idea Sergey. I'm trying to determine if this.text is '00' in the interactive change and if the lastkey entered was 13,9,15, or 24 then convert it to the year 2000. This only works if the user presses ENTER. IF the user presses TAB, SHIFT-TAB, or UP ARROW, or DOWN ARROW then it jumps right into the valid. I need to detect for '00' when the user exits the control. So far, it only works if the user presses ENTER to leave the control. Any ideas?
>
>
>*Interactive Change
>IF INLIST(LASTKEY(),13,9,5,15,24) .and. THIS.TEXT = "00"
>	this.value = ADDCENT(this.value)
>ENDIF
>
>*Valid
>
>*--Interactive change should have changed 00 to 2000 by now and all
>*--other entries left alone
>IF EMPTY(this.value)
>	this.value=YEAR(DATE())
>ENDIF
>IF UPDATED()
>	mvh_Year(lvchoice) = AddCent(mvh_Year(lvchoice))
>ENDIF
>THIS.REFRESH()
>RETURN .T.
>
>
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform