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
0
votes
1 answer
How to ref a variable value inside a button_click method
I have a class that constructs a special kind of message boxes.
In that class one of the arguments is a variable which i'm refering in the constructor
However I need that variable to be recognized out of the constructor, more specifically when i…

ng80092b
- 621
- 1
- 9
- 24
0
votes
1 answer
First() for HtmlElementCollection
I wrote a method-extension for to simualte List's First() but the returned value (actually reference, isn't?) doesn't work if I try to change a property of it, for example;
HtmlElement ele =…

Jack
- 16,276
- 55
- 159
- 284
0
votes
0 answers
How can I direct all traffic from a certain domain to any (future) page away using .htaccess?
Lets say you have "domain X" and "domain A"
"Domain A" is my domain, but I don't want ANY traffic when they have first visited "domain X".
So I need to do a ref check, and redirect all incoming traffic from "domain X" to something else (Best would…

Snowlav
- 325
- 1
- 12
- 26
0
votes
0 answers
PowerReadFriendlyName reports false buffer length
I'm making a C# program that retrieves the name of a power management scheme from it's GUID by PInvoking the Win32 function PowerReadFriendlyName. However, the function seems to report false buffer length.
Guid id = new…

osvein
- 625
- 2
- 10
- 31
0
votes
1 answer
ref out default values
I'm still trying to learn and since I don't know many peers who have a good programming knowledge I told myself to start asking more questions about good programming practices if I can't find the correct answer on the internet.
I wonder what is the…

cah1r
- 1,751
- 6
- 28
- 47
0
votes
0 answers
C# COM Interop: how to make a method that takes array parameter by value?
I'm making a C# interface which my VBA code can call. The method takes an array of string as parameter, and it has to be a ref type, pass by value (without ref in C#) gives me error when calling the function in VBA.
Error when calling the interop…

darcyy
- 5,236
- 5
- 28
- 41
0
votes
2 answers
Clojure change values of a map without changing the order
I have given a map which looks like this:
{:foo 121 :yo 85 :good 85 :nice 53 :better 35 :cheaper 26 :price 26 }
Well I want to do some mathematics on the value of the map but without changing the order of the map.
For example if I have a…

Kingalione
- 4,237
- 6
- 49
- 84
0
votes
1 answer
How can I get ref text when I have many refs in kivy label?
Please help.
I have many refs in label and when user click on first ref how can i get ref text on main.py?
I need python method which can get this ref text.
Label:
markup: True
text: "[ref=first ref]First ref[/ref] ,[ref=second…

Max Zak
- 1
- 1
0
votes
1 answer
Maintaining State with def ref in Clojure
I have the following function:
(defn best-move [tracked-moves]
(def all-scores (ref tracked-moves))
@all-scores)
Its being called by a recursive function.
I want to be able to keep passing in tracked-moves, and for them to all exist within…

user3245240
- 265
- 4
- 10
0
votes
1 answer
Kivy hyperlink in kv file
I am making a mockup of an app just for testing purposes. I am new to kivy and need some help. I want my label to have the text 'Need Help' and when pressed on want it to act as a hyper link. I have a simple class
class LoginScreen(BoxLayout):
…

Jess Patton
- 2,476
- 1
- 15
- 26
0
votes
1 answer
React accessing children in form
I can not really access my dynamically generated children in a component. I found some cases on the internet, it seems like a common problem but nothing i could properly relate to or it was not really well documented so i got more confused.
I have a…

user1377911
- 7,285
- 5
- 18
- 16
0
votes
2 answers
Git Bash, getting local branch name
Im trying to get on GIT POST-RECEIVE command the local branch name of computer, i tried the code
"READ REF" but it outputs "ref/heads/branchname" i only want the branchname, can someone please help me trim using the output using bash command or is…

user3507442
- 33
- 4
0
votes
2 answers
Passing objects into an array by reference instead of value
I was working on some C# code, and have 8 Points, which are being put into 6 Point arrays, each one with different combinations similar to the sample below:
Point pt10 = new Point(10,10);
Point pt20 = new Point(20,20);
Point pt30 = new…

Shadow
- 3,926
- 5
- 20
- 41
0
votes
2 answers
Windows phone - httpwebrequest - passing ref variables to callback
I'm sending HttpWebRequest from Windows Phone application:
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(new Uri("myurl"));
request.BeginGetResponse(MyProcessor, request);
Here's callback:
public void MyProcessor(IAsyncResult…

lenden
- 800
- 2
- 14
- 38
0
votes
2 answers
Passing control references as ref parameters
Please help me out here because im getting kind of confused.. I have a form in a C# winforms project and a couple of methods that are suposed to perform some tasks for this particular form and all derived ones, so one of those helper methods can…

Enmanuel
- 79
- 1
- 7