Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
Hi All,
IMHO KiX doesn't correctly deal with arrays returned from objects.
Code:
$=SetOption("NoVarsInStrings","On")
? Test[1] ; equals b
Function Test() $Test = "a","b" EndFunction
$d = CreateObject("Scripting.Dictionary") $d.Add("a",Split("a b")) If VarType($d.Item("a")) & 8192 ? '$d.Item("a") is an array' EndIf $a = $d.Item("a") ? $a[1] ; equals b ? $d.Item("a")[1] ; should return b but instead throws an error Get $
Some may not consider this not to be a bug but rather that this syntax is simply not supported. However, it seems logical to me that KiX should evaluate $d.Item("a")[1] to "b".
Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Another excellent find!
This kind of syntax is indeed not supported in the current versions. Changing this is non-trivial, so I will not do so for 4.52, but I will look into it for the next update.