The ability to print a table in the Expressive Output Window is fantastic and it just keeps getting better.
But I often miss seeing the index number in arrays (position in the array), in addition to the value, currently shown.
It would be very important to show the index number as well, as it serves as a reference for debugging, as for table.remove, etc.
Also, the indexed array is not being shown in numerical order, like ipairs:
Repro
Activate Expressive Output Window beta
Run this script:
local arr = {}
for i = 1, 10, 1 do
table.insert(arr, "value" .. i*5-1)
end
print("Expressive Window:")
print(arr)
print("For Ipairs:")
for i, v in ipairs(arr) do
print(i, v)
end
It will show the results like:
The last one should be the correct way to print arrays in Expressive Output Window.
Thanks for your suggestion, we will look into this. Also please keep in mind that this is not a bug but a feature request. For suggestions like this, please use the Studio Features category instead of Studio Bugs, thanks.
The order in which the indices are enumerated is not specified, even for numeric indices.
Was there a time when the Output Widget printed the array in numerical order and now you are seeing the non numerical order? If yes, then I misunderstood and this is a bug. If not, then this is a feature request as Output never had this behavior to begin with. Nonetheless we understand the advantage of printing in numerical order and will look into incorporating it into the Expressive Output Widget.
I’ve moved this to Studio features. If you want to report the other one as a bug, please use a separate thread and follow the requirements for posting a bug report.