sub CheckDate(sData)
if cint(Left(cstr(sData),2))>0 and cint(Left(cstr(sData),2))<13 then
select case cint(Left(cstr(sData),2))
case 1,3,5,7,8,10,12
if cint(Right(cstr(sData),2))>0 and cint(Right(cstr(sData),2))<32 then
msgbox "pass"
else
msgbox "fail"
end if
case 4,6,9,11
if cint(Right(cstr(sData),2))>0 and cint(Right(cstr(sData),2))<31 then
msgbox "pass"
else
msgbox "fail"
end if
case 2
if cint(Right(cstr(sData),2))>0 and cint(Right(cstr(sData),2))<30 then
msgbox "pass"
else
msgbox "fail"
end if
end select
else
msgbox "fail"
end if
end sub
'Do test
myData="0323"
CheckDate(mData)
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) | Powered by Discuz! X3.2 |