Results 1 to 4 of 4
Oct 7, 2001, 02:59 #1
- Join Date
- Jun 2001
- 0 Post(s)
- 0 Thread(s)
Evaluating Current Sub or Function
G'Day All...back from a wicked weekend away and I have an interesting question...
Is there a way of evaluating which Function or Sub the code is currently running.
Let me elaborate. Say I have an error checking Sub which handles the Err object for me but I want to know from which function or sub it was called from. Is there any way of doing that.
Say I have this error checking Sub.
Sub CheckError(whichFunction) If Err.Number <> 0 Then Session("errormsg") = "<b>Error Code:</b> " & Err.number - vbObjectError & "<br>" _ & "<b>Error Source:</b> " & Err.source & "<br>" _ & "<b>Error Description:</b> " & Err.description & "<br>" _ & "<b>Function:</b> " & whichFunction Err.Clear Response.Redirect "admin_error.asp" End If End Sub
Function Foo(x, y, z) on error resume next strsql = "SELECT * FROM table where date = ##" 'purposefully erroneous code myRS.Open strsql, myConn CheckError "Foo" End Function
Wierd question I know but I was wondering if anyone has done anything like this before.
Cheers and have a great one!
hendoSteve 'Hendo' Henderson
EnVivo!CS: Fast and Affordable Web Content Management for ASP. 100% Script, No DLLs.