ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Function prototypes in Excel VBA (https://www.excelbanter.com/excel-programming/400577-function-prototypes-excel-vba.html)

Sing

Function prototypes in Excel VBA
 
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.



Tom Ogilvy

Function prototypes in Excel VBA
 
No, there are not.

--
Regards,
Tom Ogilvy


"Sing" wrote:

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.




Peter T

Function prototypes in Excel VBA
 
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


"Sing" wrote in message
...
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.





Tom Ogilvy

Function prototypes in Excel VBA
 
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:

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


"Sing" wrote in message
...
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.






Peter T

Function prototypes in Excel VBA
 
Thanks for that Tom,

unless you know something else.


Nope !

Regards,
Peter T


"Tom Ogilvy" wrote in message
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



Bill Renaud

Function prototypes in Excel VBA
 
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.
--
Regards,
Bill Renaud




Bill Renaud

Function prototypes in Excel VBA
 
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.

--
Regards,
Bill Renaud





All times are GMT +1. The time now is 09:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com