Hi, I was wondering if anyone knows of a way to access information on methods, enums & constants for your currently loaded project(s), similar to how the Object Browser accesses them?
I'm basically looking at writing a custom object browser with extra search abilities like filtering on just constants or enums, names or values etc.
So, if I had the following code:
I'd like to be able to access that I had:
The enum 'test' with entries of a,b,c
The const 'AA_CONST' with a value of "abc"
The method SubWithByval with a byval parameter of 'this'
I can see how to get the enum, const and method names (from the Members collection in CodeModule) but not their values/parameters. The only way I can currently think of doing this is by retrieving it from the code modules by using the CodeLocation property.
For further background as to why I'm trying to do this, I'm working on a huge legacy app with no consistent approach to where constants, enums & methods are held, hopefully this would help identify duplicates and aid towards code improvement.
If anyone knows of a better way I'd be really grateful.
Thanks.
I'm basically looking at writing a custom object browser with extra search abilities like filtering on just constants or enums, names or values etc.
So, if I had the following code:
Code:
Option Explicit
Enum test
a
b
c
End Enum
Private Const AA_CONST = "abc"
Private Sub SubWithByval(ByVal this As String)
End Sub
Private Sub Form_Load()
SubWithByval
End Sub
The enum 'test' with entries of a,b,c
The const 'AA_CONST' with a value of "abc"
The method SubWithByval with a byval parameter of 'this'
I can see how to get the enum, const and method names (from the Members collection in CodeModule) but not their values/parameters. The only way I can currently think of doing this is by retrieving it from the code modules by using the CodeLocation property.
For further background as to why I'm trying to do this, I'm working on a huge legacy app with no consistent approach to where constants, enums & methods are held, hopefully this would help identify duplicates and aid towards code improvement.
If anyone knows of a better way I'd be really grateful.
Thanks.