traps and warns for invalid dates
thanks to Tim Kiebert!!
'Date Created: 30-Jul-2010 07:22:26 PM
'Last Updated: 30-Jul-2010 07:32:17 PM
'Created By : martin cole
'Updated By : martin cole
DIM SHARED bdateC as C
dim shared bdate as D
DIM SHARED edatec as c
DIM SHARED edate as D
DIM SHARED varC_result as C
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Enter Dates",<<%dlg%
{Background=#237+232+211}
{region}
From:| [%DATE;P=popup.calendar(bdateC);I=popup.calendar%.20bdateC!bdateC_*];
Thru:| [%DATE;P=popup.calendar(edateC);I=popup.calendar%.20edateC!edateC_*];
{endregion};
{line=1,0};
{region}
<15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};
%dlg%,<<%code%
IF left(a_dlg_button,7) = "bdateC_" THEN
IF a_dlg_button = "bdateC_killfocus" THEN
IF bdateC = "" THEN
bdate = {}
ELSE
IF isdate(bdateC)
bdate = ctod(bdateC)
bdateC = dtoc(bdate)
ELSE
msgbox("","Invalid Date!")
bdatec=""
ui_dlg_ctl_goto("Enter Dates","bdate")
END IF
END IF
END IF
a_dlg_button = ""
END IF
if left(a_dlg_button,7) = "edatec_" then
if a_dlg_button = "edatec_killfocus" then
IF edateC = "" THEN
edate = {}
ELSE
IF isdate(edateC)
edate = ctod(edateC)
edateC = dtoc(edate)
ELSE
msgbox("","Invalid Date!")
edatec=""
ui_dlg_ctl_goto("Enter Dates","edate")
END IF
END IF
end if
a_dlg_button = ""
end if
%code%)
thanks to Tim Kiebert!!
'Date Created: 30-Jul-2010 07:22:26 PM
'Last Updated: 30-Jul-2010 07:32:17 PM
'Created By : martin cole
'Updated By : martin cole
DIM SHARED bdateC as C
dim shared bdate as D
DIM SHARED edatec as c
DIM SHARED edate as D
DIM SHARED varC_result as C
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Enter Dates",<<%dlg%
{Background=#237+232+211}
{region}
From:| [%DATE;P=popup.calendar(bdateC);I=popup.calendar%.20bdateC!bdateC_*];
Thru:| [%DATE;P=popup.calendar(edateC);I=popup.calendar%.20edateC!edateC_*];
{endregion};
{line=1,0};
{region}
<15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};
%dlg%,<<%code%
IF left(a_dlg_button,7) = "bdateC_" THEN
IF a_dlg_button = "bdateC_killfocus" THEN
IF bdateC = "" THEN
bdate = {}
ELSE
IF isdate(bdateC)
bdate = ctod(bdateC)
bdateC = dtoc(bdate)
ELSE
msgbox("","Invalid Date!")
bdatec=""
ui_dlg_ctl_goto("Enter Dates","bdate")
END IF
END IF
END IF
a_dlg_button = ""
END IF
if left(a_dlg_button,7) = "edatec_" then
if a_dlg_button = "edatec_killfocus" then
IF edateC = "" THEN
edate = {}
ELSE
IF isdate(edateC)
edate = ctod(edateC)
edateC = dtoc(edate)
ELSE
msgbox("","Invalid Date!")
edatec=""
ui_dlg_ctl_goto("Enter Dates","edate")
END IF
END IF
end if
a_dlg_button = ""
end if
%code%)
Comment