Items in a table are retrieved in different order when using for loop

If I create a table of key/values and then iterate using “for” the items are not returned in the same order they were defined. e.g.

local t = {   
 key0 = value0,   
 key1 = value1,   
 key2 = value2  
}  

If I then iterate I don’t get key1, key2, key3 (I actually get key1, key0, key2 )

for key, value in pairs(t) do  
 print(key)  
end  

Is there any way to do this?
[import]uid: 8353 topic_id: 3237 reply_id: 303237[/import]

After some research it turns out this is “normal” in Lua.

There is a way to do this - see part of the “Simple Slide View” code contrib for an example. [import]uid: 8353 topic_id: 3237 reply_id: 9603[/import]