I just updated to the newest version of AutoIT and when I add a line of text containing "|" characters to my array using _ArrayAdd(), the array ends up with each element containing a part of my string broken at "|".
So, if I had a string like "A|B|C|D", and I did an _arrayAdd($ar, "A|B|C|D), my array then contains 6 elements:
[0] = 5
[1] = A
[2] = B
[3] = C
[4] = D
I see that the calling syntax in the old AutoIT version is quite different than the new syntax:
old:
_ArrayAdd(ByRef $avArray, $vValue)
new:
_ArrayAdd ( ByRef $aArray, $vValue [, $iStart = 0 [, $sDelim_Item = "|" [, $sDelim_Row = @CRLF [, $hDataType = 0]]]] )
The new syntax is not backwards compatible.
Sample code:
#include <Array.au3> global $ar, $str, $outstr = "" $str = "A|B|C|D" $ar = stringsplit("","") _ArrayAdd($ar, $str) $outstr &= ubound($ar) & @crlf for $x = 0 to ubound($ar) - 1 $outstr &= $ar[$x] & @CRLF Next msgbox(0, "INFO", $outstr)
New Version info: Version 3.4.4 Jul 13 2014 20:07:38
Old Version info: Version 3.3.6 Dec 30 2013 15:53:31