473,395 Members | 1,386 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,395 software developers and data experts.

params keyword

Hi

I'd like to create a function that has a variable amount of Int64 variables passed to it ... however, I'd like them to be passed as ref(so that changes are reflected in the calling method). Is there any way to implement this, so that my function works with a ref param array(or similar object), because currently param arrays cannot be passed as ref ?

Thanks

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 19 '05 #1
1 1276
as C# does not support declaring pointers to value types (like an Int64),
except with parameter ref, there is no way without dropping into C++. you
have couple choices.

create you own object type to pass to the method:

classs myInt64
{
public Int64 Value;
public void myInt64(Int64 value)
{
Value = value;
}
}

this will pass by ref (as all objecvts are passed by ref).

you could pass an array, but will have to load an inload in the caller.

-- bruce (sqlwork.com)


"michaeltorus" <michaeltours@-NOSPAM-btinternet.com> wrote in message
news:uB*************@TK2MSFTNGP09.phx.gbl...
Hi

I'd like to create a function that has a variable amount of Int64
variables passed to it ... however, I'd like them to be passed as ref(so
that changes are reflected in the calling method). Is there any way to
implement this, so that my function works with a ref param array(or
similar object), because currently param arrays cannot be passed as ref ?

Thanks

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/

Nov 19 '05 #2

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

Similar topics

2
by: Kevin Jackson | last post by:
What's the difference between public void Foo(string s, object o) and public void Foo(string s, params object o) ?
0
by: 2G | last post by:
Hi I'm try to generate params SqlParameter commandParameters but I can't get the params in there. Is it possible that it is not supported? I've read this on a webpage somewhere: params keyword...
5
by: sklett | last post by:
I have a simple debug and logging class and I would like to be able to send a non-formatted string to my various printing methods, much like string.format(). I have tried to implement this like...
1
by: Jozsef Bekes | last post by:
Hi All, I need to offer scripting possibilities in my app, and have to use MSSCriptControl for some reasons. I would like to use the feature that's called variable number of arguments, that is...
7
by: The Crow | last post by:
code snippet below briefly shows what i need to do : public void Method1(params object args) { Method2(args); } public void Method2(params object args) { //Do something.
8
by: David Duerrenmatt | last post by:
Hi there For some reasons, I've to use Python 1.5.2 and am looking for a workaround: In newer Python versions, I can call a function this way: func = some_function func(*params) Then,...
2
by: csperler | last post by:
Hi There - The code that follows does not work. I'm trying to dynamically invoke a method that contains a params-attributed parameter. However, the array of objects that are passed into the...
4
by: Gary Brown | last post by:
Hi, Why are fn(object parameters) and fn(params object parameters)
7
by: Bill H | last post by:
i'm new to C#... How can I create an out or ref param for a method without having to declare it in the caling code ? Like the DataAdapter can do on its Fill method. DataTable dt = new...
1
by: vdfvdfv | last post by:
Hi Guys, I have a dynamic JS file created by a php file I call this script using: <script type="text/javascript" src="http://www.mysite.com/jsfile.php? keyword=xxx"></script> Is it possible to...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.