View Single Post
10-26-14, 06:39 PM   #5
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
I don't know how much of this you already figured out, but

Originally Posted by mekasha View Post
I'm especially having trouble getting it to work since I'll have 4 values per line in the table, and almost every example I've come across just shows how to handle a key and single value.
You shouldn't be thinking of it like that. You have only one value, which is the table.

Code:
local value = {34132, 70.5, 63.5, "scout"}
table.insert(coords, value)
Originally Posted by mekasha View Post
Is the "for ipairs" the best way for printing out my sorted table?
If you're going to do stuff with a table very frequently there is another way of doing it than ipairs, but for a single or just a few iterations there's really no reason to complicate things. ipairs is fine.

Originally Posted by mekasha View Post
Also, for the items I do not have the coordinates for, is there a more elegant method than setting their coordinates to 1000, 1000?
Probably. Depends on how you want to treat those items.
__________________
Grab your sword and fight the Horde!
  Reply With Quote