Questions tagged [byref]
182 questions
3
votes
2 answers
Powershell / .Net: Get a reference to an object returned by a method
I am teaching myself PowerShell by writing a simple parser. I use the .Net framework class Collections.Stack. I want to modify the object at the top of the stack in place.
I know I can pop() the object off, modify it, and then push() it back on,…

Dan Menes
- 6,667
- 1
- 33
- 35
3
votes
1 answer
VBA What's the underlying difference between call Sub or Function with or without parentheses
I had an issue with passing an Array to a Sub By Reference, but the Array actually not get modified.
I managed to fix that , but I want to know why.
Here is the example.
Private Function fCountArray(ByRef arrayVar As Variant)
arrayVar(0) =…

LeY
- 659
- 7
- 21
3
votes
1 answer
Collection Object - ByRef - ByVal
I am using VBA in Access 2013.
In a regular module there are 2 procedures, RunProc() and PopulateCollection()
When RunProc is executed it calls PopulateCollection where the
argument passed is an Collection instace named MyCol.
PopulateCollection…

Michael
- 87
- 1
- 1
- 8
3
votes
5 answers
Pass by Ref Textbox.Text
I currently have something that I want to pass a textbox.text by ref. I don't want to pass the whole textbox and I want the function to change the text along with returning the other variable.
public int function(int a, int b, string text)
…

Hazior
- 696
- 4
- 10
- 26
3
votes
3 answers
Access VBA - Changing TextBox value from within a function (ByRef)
I'm trying to write a sub that will get two parameters - a textbox in a form and a text.
My intention is that the function will append the text into any textbox.
Sub AppendTextBox([any textbox in my form], text As String)
[code that appends the…

Zephram
- 499
- 3
- 7
- 16
3
votes
3 answers
Classic ASP - passing a property as byref
In Classic ASP, I have an object, call it bob. This then has a property called name, with let and get methods.
I have a function as follows:
sub append(byref a, b)
a = a & b
end sub
This is simply to make it quicker to add text to a variable. I…

ClarkeyBoy
- 4,934
- 12
- 49
- 64
2
votes
1 answer
How do I get SingleOrDefault to return object by reference from a list?
Consider these lines of code:
//prodProdGroup is a list within the itm object that I need to search. The items
//within the list are of type ProductionCostCalcHelper. I need to find one
//of the ProductionCostCalcHelper records in the list,…
user134363
2
votes
1 answer
Is a static member movable or fixed anyway?
In another topic, a nice guy told me by quote Eric Lippert's words:The significance of static has to do with the knowledge and certainties the compiler has at compile time of a certain class/struct/field what have you. It has nothing to do with…

Need4Steed
- 2,170
- 3
- 22
- 30
2
votes
1 answer
PHP4 parameter by reference?
I'm quite used to PHP5 but have to write a PHP4 sync script, now I'm doing some digging to find the differences between PHP5 and 4. Problem is that I get alot of contradiction, some sites tell me that PHP4 has no byref whatever and others tell me…

Rob
- 2,466
- 3
- 22
- 40
2
votes
3 answers
cache being modified instead of local variable (pass by ref)
I am writing a .net c# application.
I retrieve some data from an xml file, cache the data to the .net cache and return it from my method. I perform some processing on the data and return it another part of my application.
Next call, I read from…

amateur
- 43,371
- 65
- 192
- 320
2
votes
1 answer
Implicit ByRef in legacy Visual Basic code
I have to copy an algorithm from a legacy Visual Basic software and there is one thing about the code that I don't understand.
It seems the author has used some way to implicitly pass simple data types like integers by reference. The first time I…

daign
- 899
- 1
- 10
- 18
2
votes
2 answers
c# to f# when 3rd party lib wants a byref as an out parameter
I’m trying to convert this method into F#
private static bool VerifySignedJwt(ECDsa eCDsa, string token) {
var tokenHandler = new JwtSecurityTokenHandler();
var claimsPrincipal = tokenHandler.ValidateToken(token, new…

user1796185
- 168
- 2
- 13
2
votes
2 answers
Override List(of String) Elements in a Sub
The following example is simplified. In my project I have a big List(of String) where I have to do some manipulations on the strings. For this I created a Sub where I do the manipulation and that should rewrite the Elements of the List(of String).…

ruedi
- 5,365
- 15
- 52
- 88
2
votes
2 answers
In .NET if you pass a struct into a method with an interface parameter does it box the value?
From a simple test I can see that if you pass the struct into the method it is passed by value but if you first assign it to an interface it is passed by reference.
interface IFoo { int Val { get; set; } }
struct Foo : IFoo { public int Val { get;…

justin.m.chase
- 13,061
- 8
- 52
- 100
2
votes
2 answers
D - store reference to subarray in variable
I have code like this:
int[][] array = [[1, 2], [3, 4]];
auto line = array[0];
line ~= 5;
I assume line contains a copy of subarray and array is not modified when line is. Is it possible to store subarray as reference?

mcferden
- 316
- 3
- 11