What is VBA's procedure calling syntax matrix?

  • Thread starter Thread starter baobob
  • Start date Start date
B

baobob

When (if at all) do you use MYPROC x, y?
When (if at all) do you use MYPROC(x, y)?
When (if at all) do you use CALL MyProc x, y?
When (if at all) do you use CALL MyProc(x, y)?

***

As an OOP programmer, and more relevantly as a user of human
communication, this is a nightmare. And it costs users THOUSANDS of
hours.

Here's Object Pascal's syntax: MyProc(x, y). PERIOD.

Microsoft. Bigger is worse.

***
 
The ones without parentheses you don't use at all, AFAIK.
The ones with parentheses, you use to call (run) the MyProc macro AND pass
the x and y values to the called macro. If you are passing a value to the
called macro, you must use the "Call". I have found it good practice to use
the "Call" whenever I am calling another macro, whether or not I am passing
a value to the called macro. As in anything else, if you understand it it's
not difficult at all. HTH Otto
 
The last time I checked, it was still a free market economy which means the
user can choose the software they want to work with. So I guess a lot of
people had rather use VBA and those who don't will use something else.
 
It's not clear to me that the poster has any objective other than to appear
to be a fool. However I suggest that s/he open VB Help in Excel and consult
the section Visual Basic Language Reference->Statements->Call. It's
actually explained clearly and concisely there. I also have a lot if issues
with MS but the nightmare here is that the poster is being ridiculous.

LA
 
You can use
MYPROC x, y
or
Call MyProc(x, y)
both do exactly the same thing. I hope that has saved THOUSANDS of hours. I
have programmed in Pascal, Java, Delphi, C, C++ and VB/VBA. Every language
has it's own odd set of syntax rules and quirks.

My personal preference is Call MyProc(x, y) as it is the most explicit line
of code and it makes it easy to quickly spot which procedures are called from
a given sub.
 

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

Back
Top