Thread: ipairs bugged?
View Single Post
07/21/14, 12:11 PM   #2
Khaibit
 
Khaibit's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 26
Originally Posted by zgrssd View Post
As far as I understand the only difference between pairs and ipairs should be that ipairs goes by alphabetical/numerical order. Both should still go over all the data.

But when given a table like this:
[1] = "CHAT_CATEGORY_SAY"
[2] = "CHAT_CATEGORY_YELL"
[3] = "CHAT_CATEGORY_WHISPER_INCOMING"
[4] = "CHAT_CATEGORY_WHISPER_OUTGOING"
[6] = "CHAT_CATEGORY_ZONE"
... (the table is in total 41 entries long)

ipairs will stop dead after entry 4.
As opposed to pairs, wich goes properly over the full table.

As far as I understand the syntax those are global functions.
Any chance Zenimax bugged ipairs up?
Any chance some addon is overwriting ipairs with a faulty version?
From what I understand, ipairs only works with "well-formed" tables (i.e. sequential indices without any gaps, 1-indexed). Your table is missing index 5, which is why ipairs stops there.
  Reply With Quote