Opened on May 10, 2014 at 11:18:07 PM
Last modified on Dec 8, 2015 at 5:48:39 PM
#2713 closed Bug
ByRef Copy Bug — at Version 1
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.11.5 | Severity: | None |
| Keywords: | byRef | Cc: |
Description (last modified by )
In the following script, the presence of ByRef causes $b to be a reference, not a copy.
Local $a[2] = [1, 2]
test($a[0])
Func test(ByRef $foo)
Local $b = $a
$foo += 1
ConsoleWrite($a[0] & @LF)
ConsoleWrite($b[0] & @LF)
EndFunc ;==>test
Note:
See TracTickets
for help on using tickets.

This has been discussed here: http://www.autoitscript.com/forum/topic/161296-supposed-byref-bug/ (Link is to MVP section)
I've changed the code in the report to be much simpler, without the OPs attempt to write object oriented AutoIt without objects.