473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to Tell if a Parameter is ByVal or ByRef

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
Jul 29 '05 #1
3 1215
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.
"Charles Law" <bl***@nowhere.com> wrote in message
news:uE**************@TK2MSFTNGP09.phx.gbl...
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

Jul 29 '05 #2
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" <Wi*********@nospam.gmail.com> wrote in message
news:Or**************@tk2msftngp13.phx.gbl...
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.
"Charles Law" <bl***@nowhere.com> wrote in message
news:uE**************@TK2MSFTNGP09.phx.gbl...
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


Jul 29 '05 #3
W.G. Ryan MVP <Wi*********@nospam.gmail.com> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 29 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tom | last post by:
Hello all, I have a problem to consult you and hope your help. My work case like this: --------------------- a VB6 COM DLL has a method ,Which has a Byref parameter for return the changed...
1
by: Bobby | last post by:
Hello, I'm seeing strange behavior experimenting with calling .NET. If I create a project in .NET 2k3 and select 'interop assembly' it will create the CCW for me, correct? I created a class...
2
by: pecker | last post by:
I have a com dll interface: Public Function Hulian_Acount_all(ByVal vIndex As Variant, _ ByRef vDate As Variant, _ ByRef vCount As Variant, _ ByRef vMoney As Variant, _ ByRef vMyDetail As...
2
by: xinsir | last post by:
dynamic array as a byref parameter by used in function and have a Marshal error ,what is the matter?thanks source like as this . ------------------------------------------------------ Declare...
2
by: Witold Iwaniec via .NET 247 | last post by:
It seems that when you pass an object to a function it is always passed by reference even if it is explicitly declared ByVal. Is it the behavior of VB.Net? Here is sample code from sample Asp.Net...
6
by: **Developer** | last post by:
Notice below I sometimes used the "A" version. I found by cut-and-try that only the "A" version would work correctly. Anyone have a suggestion of why the "W" version would not work correctly? ...
20
by: Brien King | last post by:
If I have a parameter that has an Object type (as opposed to something like a string), can I make that parameter a CONST? Right now, if you pass an object into a sub/function, that sub/function...
3
by: Charles Law | last post by:
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...
2
by: JB | last post by:
Hi All, I'm pulling my hair over this and could really do with a bit of help. I'm using various different enums as bit fields and I'd like to create a set of generic Functions or Subs to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.