Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time info of functions

Status
Not open for further replies.

knovak

Programmer
Dec 18, 2001
17
US
Is there a way to get the run-time information of a function? i.e. How many params the function takes and the data type of each parameter. I'm using VB 6.

Thanks,

Kyle
 
The Object Browser, which can accessed through VBs standard toolbar, will give you information about methods & properties that belong to objects and exist in modules.

Hope this answers your question
Josh
 
Not the Object Browser, I'm aware of that. I want to know the run-time information of a function i.e. when the program is running, I want to know the list of parameters and their data types.
 
Not sure if this is what you mean, but at run-time in the development environment, you can View Local variables by choosing Local from the View menu. Put in a breakpoint where you want to stop the code and look at variables. In the immediate window you can also query variables and change properties. You can even hover the cursor over the code and see the current value of a variable.

Private Function DoIt(ByVal nInput as Long) as Boolean
nInput = nInput * nInput
if nInput > 0 then DoIt = True
end function

Insert a breakpoint at the second line of code and run it.
Code execution stops at the breakpoint.
In the Immediate window type:
?nInput
and hit return and you'll see the current value of nInput
OR
hold your mouse over any occurence of nInput in the code
and you'll see a tooltip that shows you its value
OR
in the Locals window, click on the node for the nInput variable to see it's value. Works with objects and their properties, though some libraries hide info (not sure why).

scarfhead
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top