VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RE: ByVal and it's purpose Rag on a Stick (4 replies, 0 views) (2000-Nov-30) ByVal = By Value
ByRef = By Reference
These two are the only two options (to my knowledge) which can be used when passing expressions.
When something is passed ByRef, the memory address of it is passed, not the actual value. This means that it must exist in memory somewhere and also, it means that if it is a varible which is being passed which already has a memory address, then its value can be changed by the sub/function.
When something is passed ByVal, the actual value of it is passed, this means it does not need to exist in memory as a variable and it cannot be changed by the sub/function even if it is a variable as the sub/function will create its own copy of the expression.
I think that's about it, although I think I used some incorrect terminology (mixing up variable with expression I think in some places) but that is the jist.
oh, and I suppose I should give a short answer as well:
It will pass the number 0, not a reference to anything or anywhere.
|