错误函数,改为: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

解决方案 »

  1.   

    这样就应该清楚了Public Function ForExample(…………) As Boolean
      

  2.   

    或者
    Public Function ForExample(…………) As Long    'ForExample=False 改成
         ForExample=0    'ForExample=True 改成
         ForExample=-1 这样比较容易看明白
      

  3.   

    其实在这里就是初始值。Private Sub Command1_Click()
    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
      

  4.   

    同意northwolves(野性的呼唤)的说话。UP
      

  5.   

    一开始设置为 真,就是没有错误。一旦出错,则程序转移到FuncError: 标号处,设置为 False。