from
Arrays are NOT passed by REFERENCE
They ARE a reference type which is entirely different
To illustrate
To show its pass by value
Sub FOO( anarray() as integer )
dim anotherarray() as integer = Array(1,2,3)
anarray = anotherarray
system.debuglog anarray.count.ToString
end sub
// and call it
dim original() as integer = array(8)
system.debuglog original.count.ToString
foo(original)
system.debuglog original.count.ToString
Now for the BYREF version where we pass a REFERENCE TYPE BYREF
Sub FOO( byref anarray() as integer )
dim anotherarray() as integer = Array(1,2,3)
anarray = anotherarray
system.debuglog anarray.count.ToString
end sub
// and call it
dim original() as integer = array(8)
system.debuglog original.count.ToString
foo(original)
system.debuglog original.count.ToString
The first gives
1
3
1
The second ?
1
3
3
The entire thread is full of half truths and misinformation about Arrays & how Xojo uses LLVM
And no one on the Xojo team is willing, or able, to step in & correct the incorrect items
Sad
