Reputation: 23
This is a syntax question. I am confused as to when the "return variable" in a Function is used as a return variable or as a method call. For instance, if I have:
Function foo() As Boolean
foo = True
foo = foo And bar
End Function
Does the second line in this function act as a recursive call to foo, or does it resolve to true from the previous assignment?
Upvotes: 2
Views: 1054
Reputation: 4657
To get the value as of the last assignment:
foo = foo And bar
To make a recursive call:
foo = foo() And bar
The ()
makes all the difference. (BTW, this applies to VBA too.)
Upvotes: 3