Array is not being shown in numerical order using print() with Expressive Output Window beta

As initially shown in this topic, the current Expressive Output Window beta is showing arrays via print() in a non-numerical order.

Repro

  1. Activate Expressive Output Window beta
  2. 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
  1. It will show the results like:

The first block is showing the array in a non-numerical order.
The last one should be the correct way to print arrays in Expressive Output Window.

Thanks for the report! We’ve filed this internally and we’ll follow up here when we have an update for you.

1 Like

Some changes have been made (and again nobody has been warned, as usual :neutral_face:), however, instead of the array is being sorted by the index number, it is being sorted alphabetically.
This is wrong.

Also, the Id number must be appearing before the value, and currently, no number is shown.
Not showing the array index number complicates a lot of debugging where I must make a comparison between two tables, where for example, the first table has an indexed list and the second table refers to the Id of the first.
Without showing the array Id, I cannot check the relationship between the two tables.

@MisterRedTurtle
I noticed a small evolution since Studio 452: now, array Id numbers are showing up. Congratulations!
Now, to be perfect, just show the array in numerical order:

@MisterRedTurtle
Almost there!
The array is now being ordered by Id, but unfortunately, in alphabetic order.

The be correct, it should be ordered by Id in numeric order.

Oh yeah!
Now it’s perfect:

Solved in version 454.

Thank you! :clap: :clap: :clap:

2 Likes

This issue should now be resolved! If this issue is still occurring, please create a new topic for us to look into.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.