I have read the tutorial on this and I have the understanding that primitives are passed by value and all others by reference, and that strings are not primitives. This is my code :
s1 = "abc"
SetVal(s1)
log(s1) 'I'd expect this to print 'xyz' but it prints 'abc'
sub SetVal(s2 as string)
s2 = "xyz"
end sub
So either a string is a primitive and is passed by value, or passing ByRef is not supported in this sense.
s1 = "abc"
SetVal(s1)
log(s1) 'I'd expect this to print 'xyz' but it prints 'abc'
sub SetVal(s2 as string)
s2 = "xyz"
end sub
So either a string is a primitive and is passed by value, or passing ByRef is not supported in this sense.