for k, v in pairs() -- And for k, v in ipairs()I have looked around and do not really get what they do. So I came here.
If you can please explain what each one does, or how it would be used. Please help when possible. Thanks in advance.
Posted 18 October 2012 - 04:41 PM
for k, v in pairs() -- And for k, v in ipairs()I have looked around and do not really get what they do. So I came here.
Posted 18 October 2012 - 04:42 PM
Posted 18 October 2012 - 04:46 PM
Posted 18 October 2012 - 04:49 PM
billysback, on 18 October 2012 - 04:46 PM, said:
Posted 18 October 2012 - 04:51 PM
Noodle, on 18 October 2012 - 04:44 PM, said:
Posted 18 October 2012 - 04:53 PM
ChaddJackson12, on 18 October 2012 - 04:51 PM, said:
Noodle, on 18 October 2012 - 04:44 PM, said:
tbl = fs.list("") -- Main directory for k, v in pairs(tbl) do print(v) -- Prints all the files in the directory end
Posted 18 October 2012 - 04:54 PM
Noodle, on 18 October 2012 - 04:53 PM, said:
ChaddJackson12, on 18 October 2012 - 04:51 PM, said:
Noodle, on 18 October 2012 - 04:44 PM, said:
tbl = fs.list("") -- Main directory for k, v in pairs(tbl) do print(v) -- Prints all the files in the directory end
Posted 18 October 2012 - 04:55 PM
ChaddJackson12, on 18 October 2012 - 04:54 PM, said:
Noodle, on 18 October 2012 - 04:53 PM, said:
ChaddJackson12, on 18 October 2012 - 04:51 PM, said:
Noodle, on 18 October 2012 - 04:44 PM, said:
tbl = fs.list("") -- Main directory for k, v in pairs(tbl) do print(v) -- Prints all the files in the directory end
Posted 18 October 2012 - 04:57 PM
Noodle, on 18 October 2012 - 04:55 PM, said:
ChaddJackson12, on 18 October 2012 - 04:54 PM, said:
Noodle, on 18 October 2012 - 04:53 PM, said:
ChaddJackson12, on 18 October 2012 - 04:51 PM, said:
Noodle, on 18 October 2012 - 04:44 PM, said:
tbl = fs.list("") -- Main directory for k, v in pairs(tbl) do print(v) -- Prints all the files in the directory end
Posted 18 October 2012 - 05:07 PM
Posted 18 October 2012 - 05:11 PM
t = { [1] = 'eggs'; [2] = 'cereal'; [3] = 'pancakes'; [5] = 'waffles'; -- I skipped 4 for a reason. myfavorite = 'bacon'; myleastfavorite = 'toast'; }
for i,v in pairs(t) do print(i,v) end
for i,v in ipairs(t) do print(i,v) end
Posted 18 October 2012 - 05:20 PM
Posted 18 October 2012 - 05:31 PM
Posted 18 October 2012 - 05:32 PM
Posted 18 October 2012 - 05:37 PM
Posted 18 October 2012 - 05:43 PM
Posted 18 October 2012 - 06:03 PM
0 members, 1 guests, 0 anonymous users