Quote Originally Posted by wqweto View Post
Not possible in VB6.

I always declare Private Const MODULE_NAME As String = "frmMain" near the top of the module and Const FUNC_NAME As String = "CkAssign_Click" at the beginning of the routine so my error handling code is always ErrorLog MODULE_NAME & "." & FUNC_NAME in your parlance.

This is the simplest most hassle-free way of doing it.

There is slim chance that TwinBasic might predeclare similar consts at the compiler level the way most C/C++ compilers have __FILE__, __FUNCTION__ and __LINE__ predeclared defines.

cheers,
</wqw>
Reading this post actually gave me an idea, that this could all be automated. One could write a program to insert this into all their VB6 code automatically. You could use a very naïve parser to figure out the names of modules, classes, subs etc and insert the constant declarations using that data.