Posted 06 November 2012 - 09:55 AM
ok, so there are some things i really cant understand in computercraft. my question here is could you explain the following things further. i have seen all of these used A LOT in code. so here are the things i cant understand. could you tell me what each one does and how it can be used in code?
thanks -Cheeky.
1. Tables
the next one is tonumber()
i do not know anything about this and do not understand it at all =/
and the last one is inpairs. im not sure if this is a function or what but ive seen it been used in for loops a lot. so like this
i have no idea what inpairs means or does. please can someone help me out on these?:P/>/>
thanks -Cheeky
thanks -Cheeky.
1. Tables
i do not understand how tables can be used at all. i know how to create one like the following.
local options = {
"option1",
"option2",
}
but i do not know how this can be used in code. please can someone explain.
the next one is tonumber()
i do not know anything about this and do not understand it at all =/
example:
the function
tonumber()
and the last one is inpairs. im not sure if this is a function or what but ive seen it been used in for loops a lot. so like this
for k,v inpairs do
-code
end
i have no idea what inpairs means or does. please can someone help me out on these?:P/>/>
thanks -Cheeky