J joneden Active Member Licensed User Longtime User Oct 29, 2015 #1 Hi Erel, Is there anything planned to implement ByRef variables in function calls? So many of my routines would be massively simplified if ByRef vars could be used. Regards Jon
Hi Erel, Is there anything planned to implement ByRef variables in function calls? So many of my routines would be massively simplified if ByRef vars could be used. Regards Jon
Erel B4X founder Staff member Licensed User Longtime User Oct 29, 2015 #2 Objects are passed by reference. If you need to pass a numeric variable by reference then you can create a single element array. Upvote 0
Objects are passed by reference. If you need to pass a numeric variable by reference then you can create a single element array.
J joneden Active Member Licensed User Longtime User Oct 29, 2015 #3 Thanks Erel, now I remember reading about that before. You specified that a numeric variable can be done with an array - I assume that string and other primitives can also be done with the array approach? Upvote 0
Thanks Erel, now I remember reading about that before. You specified that a numeric variable can be done with an array - I assume that string and other primitives can also be done with the array approach?
Erel B4X founder Staff member Licensed User Longtime User Oct 29, 2015 #4 Strings are objects so they are passed by reference. However strings are immutable. If you want to modify the string then you should use StringBuilder. Primitives = Numeric variables, booleans and chars. Upvote 0
Strings are objects so they are passed by reference. However strings are immutable. If you want to modify the string then you should use StringBuilder. Primitives = Numeric variables, booleans and chars.
J joneden Active Member Licensed User Longtime User Oct 29, 2015 #5 That's great thanks for the advice Erel! Upvote 0