Function prototypes in Excel VBA

S

Sing

Dear Excel VBA Gurus,

Is there any function prototypes equivalent in Excel VBA as there are in C
language?

Function prototypes are useful because it allows the programmer to see what
are the functions implemented in a file at the top.
 
P

Peter T

Maybe(?) look at the two drop downs at the top of modules in the VBE.

For more info, arguments etc -
select your project in the left panel
F2 Object Browser
in libraries (the top drop down) select your project name.

Regards,
Peter T
 
T

Tom Ogilvy

Peter,
In my experience, C function prototypes show how the function is calculated
- not what the inputs are. There is no equipvalent in VB or VBA unless you
know something else.
 
P

Peter T

Thanks for that Tom,
unless you know something else.

Nope !

Regards,
Peter T


Peter,
In my experience, C function prototypes show how the function is calculated
- not what the inputs are. There is no equipvalent in VB or VBA unless you
know something else.

--
regards,
Tom Ogilvy


"Peter T" wrote:
<snip>
 
B

Bill Renaud

My quick search of the web gave several examples similar to the following:

float doubleIt(float inVal);

...which is effectively just the top line of code of the routine, which
lists the arguments, their return types, and the return type of the
routine. The Object Browser in VBA would essentially perform the same
functionality.

I think you would have to have a flowchart (and possibly diagrams, like
data flow and/or event flow) to show the algorithm of how a function is
calculated.
 
B

Bill Renaud

Is your question really about "header files"? VBA does not use header files
(that list all functions, their arguments, return types, etc.), because
this is just extra work for the programmer and can lead to errors. In C, if
a programmer changes the main code file, and forgets to change the header
file, then a compile error results.

In VBA, you open up the project that has the routines that you want to
inspect, then go into the Object Browser (<F2> key in the VBA Editor),
select the Library in the Library drop-down combo box, then inspect the
methods and properties, as mentioned in a previous post by Peter T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top