错误函数,改为:Public Function ForExample(…………) As boolean On Error Goto FuncError ForExample=True '有什么作用?---->无操作时的逻辑值 ……………………… ……………………… Exit Function FuncError: ForExample=False WriteErrLogFile " ForExample ", "错误号:" & Err.Number & ",错误源:" & Err.Source & ",错误描述:" & Err.Description MsgBox "……… ", vbCritical '在此作内存资源回收工作 End Function
Public Function ForExample(…………) As Long 'ForExample=False 改成
ForExample=0 'ForExample=True 改成
ForExample=-1 这样比较容易看明白
MsgBox todayiswen(Date)
MsgBox todayiswen(#3/13/2003#)
End Sub
Function todayiswen(ByVal thedate As Date) As Boolean
todayiswen = False
If thedate = #3/12/2003# Then todayiswen = True
End Function