When to use parenthesis and when to not?

When to use parenthesis and when to not?

mdhutchinson
Advisor Advisor
300 Views
2 Replies
Message 1 of 3

When to use parenthesis and when to not?

mdhutchinson
Advisor
Advisor
What is the secrete to knowing when to use a set of parenthesized when calling a procedure....

If it is a Function procedure that returns a value then it must be called

ReturnedVal = myfunction (arg1, arg2, ...)

but if no value is returned then the parens can be excluded?

Is this correct?
0 Likes
301 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Yes.

wrote in message news:5454214@discussion.autodesk.com...
What is the secrete to knowing when to use a set of parenthesized when
calling a procedure....

If it is a Function procedure that returns a value then it must be called

ReturnedVal = myfunction (arg1, arg2, ...)

but if no value is returned then the parens can be excluded?

Is this correct?
0 Likes
Message 3 of 3

Anonymous
Not applicable
I agree it can be confusing at times. A sub may also be called with
parenthesis as Call MySub(MyParam1, MyParam2) or without as MySub MyParam1,
MyParam2. Whatever you do be careful if you call a sub as "MySub
(MyParam1)". The editor will put a space in front of the parenthesis and
pass the "value" of MyParam1 to the sub which may not be the "reference" you
really wanted.

LJB
0 Likes