51Testing软件测试论坛

标题: 请教CVDate()函数的作用是什么?请多指教 [打印本页]

作者: donkey0702    时间: 2007-7-9 14:35
标题: 请教CVDate()函数的作用是什么?请多指教
我想问一下CVDate()在下面程序中的作用, 因为我去掉了以后决定对最终结果并没有影响.请多指教
Sub main
   Dim str1 as String
   Dim answer as Integer
   Dim nextweek
   Dim msgtext
i: str1=InputBox$("Enter a date:")
   answer=IsDate(str1)
   If answer=-1 then
      str1=CVDate(str1)
      nextweek=DateValue(str1)+7
      msgtext="One week from the date entered is:"
      msgtext=msgtext & Format(nextweek,"dddddd")
      MsgBox msgtext
   Else
      MsgBox "Invalid date or format. Try again."
      GoTo i
   End If
End Sub
作者: ilovejolly    时间: 2007-7-12 17:38
类型转换的函数吧,vb是弱类型的。




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2