Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
LPARAMETERS txDateValue
IF PCOUNT() = 0
RETURN DATE()
ENDIF
DO CASE
CASE VARTYPE(txDateValue) = "D"
RETURN txDateValue
CASE VARTYPE(txDateValue) = "C" && I am assuming date format "mm/dd/yyyy"
lnMon = CAST(GETWORDNUM(txDateValue, 1, "/") AS I)
lnDay = CAST(GETWORDNUM(txDateValue, 2, "/") AS I)
lnYr = CAST(GETWORDNUM(txDateValue, 3, "/") AS I)
DO CASE
CASE lnDay > 0 .AND. lnMon > 0 .AND. lnYr > 0
RETURN DATE(lnYr, lnMon, lnDay)
CASE lnDay > 0 .AND. lnMon > 0 .AND. lnYr = 0
RETURN DATE(YEAR(DATE()), lnMon, lnDay)
CASE lnDay > 0 .AND. lnMon = 0 .AND. lnYr = 0
RETURN DATE(YEAR(DATE()), MONTH(DATE()), lnDay)
OTHERWISE
RETURN DATE()
ENDCASE
ENDCASE
Why?!?Thank you all for your help. I placed the code in the attachment in the Keypress event of the Textbox.
* textbox keypress event
IF NOT PEMSTATUS(_Screen, "oDT", 5)
*SET PROCEDURE TO (m.lcPath+"..\src\DTCLASS.prg")
_Screen.AddProperty( "oDT", CREATEOBJECT("_DATE"))
_Screen.oDT.AutoFillDate=1
ENDIF
This.Value=_Screen.oDT.ToDate(This, This.Text)