The ref keyword causes an argument to be passed by reference, not by value. The effect of passing by reference is that any change to the parameter in the method is reflected in the underlying argument variable in the calling method. The value of a reference parameter is always the same as the value of the underlying argument variable.
Questions tagged [ref]
1394 questions
-1
votes
1 answer
What difference between @load() and ${}
code:
returns:
true
false
${} not working with @ref()?

user5824492
- 11
- 2
-1
votes
2 answers
#REF! error in google sheets
I have a spread sheet which can be viewed at https://docs.google.com/spreadsheets/d/1bhIV1ULLXhjdSO_5Q5l5ZNe7Zaxrj15CYMW88FMFgRU/edit?usp=sharing
The way the spread sheet works is when a selection from the list is made the specific cells reference a…

Cage
- 11
- 1
- 1
-1
votes
2 answers
External reference to a file that gets replaced
I've got a file on my local drive that is being replaced with a newer version of it every 10 minutes.
I'd like to make a function reference to this file in another workbook, but the link is being broken every time the automatically generated file…

M. W.
- 1
- 2
-1
votes
1 answer
#Ref! error in excel formula
I have used my formula
=SUM(D8:D11)-D12-D13-D14-D15
My main data in D1 to D11. Sometimes D12, D13, D14 & D15 data will be blank. Then I will remove the above D12, D13, D14, D15 data. Then It will be #ref! error.
Are there any solutions to avoid…

Dider Elahi
- 79
- 1
- 1
- 4
-1
votes
2 answers
How can I call a method within a method and use the same variables
I am new in programming and I am stuck in a C# problem. I want to create a console program where the user fills in some personal information and the console prints these information. I am trying to use ref but I can't connect the answers from the…

fold yourdesign
- 35
- 1
- 1
- 2
-1
votes
3 answers
Is it Out can be used for passing a reference type (i.e) Objects?
Consider the following example, here int i is passed for the reference.
My question is, Can i pass a reference type to out? like object (i.e) static void sum(out OutExample oe)
class OutExample
{
static void Sum(out int i)
{
i = 5;
…

Balaji
- 1,375
- 1
- 16
- 30
-1
votes
2 answers
C# Call to unmanaged Delphi DLL returns a partially corrputed structure
I'm having some issues where data in a structure that I pass to an unmanaged DLL written in Delphi (version unknown) seems to be getting corrupted. Would someone please do a sanity check on my code.
The project is build with VS2012 targeting the…

MincedMeat
- 1
- 2
-1
votes
2 answers
How to make a class with multiple methods that return a value?
I have created a class that needs to alter a variable's value when it is instantiated.
Example:
In my LrgDialogBox class I might have:
public LrgDialogBox(ref oldResult)
{
// bunch of code
UserInput();
}
public UserInput()
{
…

Kris
- 1
-1
votes
1 answer
use filename ref instead of path(string) while opening an Excel in Windows c#
I would need to pass the file name ref instead of giving string (full path) while opening or saving Excel in C#. Below is a code snippet
object fileName = (string)e.Argument;
object oMissing = System.Reflection.Missing.Value;
if…

user1665707
- 615
- 3
- 11
- 24
-1
votes
1 answer
ws02 dataservice use parameter IN ORACLE_REF_CURSOR
I use WSO2 DataService for my web services. How can declare a parameter with:
parameter IN
type ORACLE_REF_CURSOR
I do not have any problem with OUT parameter.
-1
votes
2 answers
Copy list objects value not reference
I'm try to create a new list object. I set the new object to an old existing object.
List names = new List();
names = olderList;
The problem I have is that the names list points to the olderList as a result when olderList changes,…

CodeNoob
- 411
- 1
- 7
- 24
-2
votes
1 answer
How do we know where a url is coming from?
Say we have two buttons with the same url, is is possible for us to figure out which button was clicked by my user to fetch that particular page.
I have already explored query parameters (ref_ tag) so I am looking for a second approach. Anyone has…

Shriyal
- 1
- 1
-2
votes
2 answers
Unexpected behavior using By Ref with Reference type Dictionary
Experienced an unexpected behavior when using Dictionary type and passing by reference.
Within a nested call, the reference to the underlaying base dictionary seems to be lost or replaced.
All child method calls are passing the dictionary by…

Peter O Brien
- 105
- 2
- 6
-2
votes
2 answers
Unassigned ref value in the constructor
I want to assign output values on Data class after create object with ref constructor to State class in this code. How can I solve this?
class Program
{
static void Main(string[] args)
{
Data data = new Data();
State stateA =…

Emre
- 1
- 2
-2
votes
1 answer
For loop with ref array in C#
how does this loop work that i get the result of 11, 2, 13, 4, 15?
What i mean is to explain how one number enters the for loop and what happens
static void Main(string[] args)
{
int[] arr = new int[] { 1, 2, 3, 4, 5 };
…

Eni
- 9