Programatically get current function / sub name vb6

Does anyone know how to programatically get current function / sub name in vb6. Or a stack trace or something similar.

It will help with my error handling. I don't want to have to write different code in every function and sub.

Thanks.


Comments

  • : Does anyone know how to programatically get current function / sub name in vb6. Or a stack trace or something similar.
    :
    : It will help with my error handling. I don't want to have to write different code in every function and sub.

    procedure names are not preserved per se in the compiled program. Here is the standard that we use:

    Public/Private Sub/Function Foo(...)
    On Error GoTo ProcedureError
    Const kstrProcedureName = "Foo"

    ...

    End Sub/Function

    You have to remember to set the value for the constant string to the name of the procedure enclosing it, but it makes the ProcedureError block easier to cut-n-paste because every single procedure can refer to kstrProcedureName at runtime.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion