How to Tell if a Parameter is ByVal or ByRef

  • Thread starter Thread starter Charles Law
  • Start date Start date
C

Charles Law

Using the DTE code model, I can get a CodeParameter object for each
parameter to a given function. But how do I know whether it is a ByRef or
ByVal parameter? There doesn't appear to be any property of the
CodeParameter object that indicates this.

TIA

Charles
 
Charles, the more important distinction is whether or not the parameter is a
value type or a refernce type. B/c if it's a reference type, even if you
pass it by value, you're passing a reference which can be changed.
 
I agree that that is relevant, but at the moment I just want to be able
determine the ByVal / ByRef attribute so that I can auto-generate some
documentation.

Charles
 
W.G. Ryan MVP said:
Charles, the more important distinction is whether or not the parameter is a
value type or a refernce type. B/c if it's a reference type, even if you
pass it by value, you're passing a reference which can be changed.

Both distinctions are very important. There's still a big difference
between passing by reference and passing by value, even if you're
passing a reference.
 
Back
Top