How To Use Tables.
#21
Posted 12 December 2013 - 09:13 PM
My English isnt the best but hopefully understandable
Thanks
#22
Posted 08 March 2014 - 01:57 AM
#23
Posted 16 March 2014 - 02:22 AM
#24
Posted 16 March 2014 - 02:40 AM
IsaacTBeast, on 16 March 2014 - 02:22 AM, said:
Edited by theoriginalbit, 16 March 2014 - 02:40 AM.
#25
Posted 16 March 2014 - 10:14 AM
#26
Posted 16 March 2014 - 10:15 AM
Edited by theoriginalbit, 16 March 2014 - 10:16 AM.
#27
Posted 16 March 2014 - 06:40 PM
#28
Posted 19 March 2014 - 08:01 PM
theoriginalbit, on 16 March 2014 - 02:40 AM, said:
IsaacTBeast, on 16 March 2014 - 02:22 AM, said:
I thought you could do this, if you really wanted to:
MyTable = {
PrintStuff = function(Stuff)
print(Stuff)
end
}
MyTable.PrintStuff("Hello, World!")
That is technically calling a table. ;DEDIT:
I think this is a great tutorial for beginners, OP. Good going.
Edited by MostwantedRBX, 19 March 2014 - 08:02 PM.
#29
Posted 19 March 2014 - 08:06 PM
#30
Posted 19 March 2014 - 10:49 PM
MostwantedRBX, on 19 March 2014 - 08:01 PM, said:
MyTable = {
PrintStuff = function(Stuff)
print(Stuff)
end
}
MyTable.PrintStuff("Hello, World!")
That is technically calling a table. ;D#31
Posted 19 March 2014 - 10:58 PM
theoriginalbit, on 19 March 2014 - 10:49 PM, said:
MostwantedRBX, on 19 March 2014 - 08:01 PM, said:
MyTable = {
PrintStuff = function(Stuff)
print(Stuff)
end
}
MyTable.PrintStuff("Hello, World!")
That is technically calling a table. ;DLol, I suppose. From the computing definitions I've seen from google(Yep, I looked it up), calling is to cause the execution of, and accessing is to obtain, examine or retrieve.
Edited by MostwantedRBX, 19 March 2014 - 10:59 PM.
#32
Posted 19 March 2014 - 11:03 PM
MostwantedRBX, on 19 March 2014 - 10:58 PM, said:
local tData = setmetatable({"hello", "world"}, {
__call = function(t, i)
return t[i]
end
})
As stated, it allows you do do the followingprint(tData[1]) --# outputs: hello print(tData(1)) --# outputs: hello
Edited by theoriginalbit, 19 March 2014 - 11:04 PM.
#33
Posted 19 March 2014 - 11:19 PM
theoriginalbit, on 19 March 2014 - 11:03 PM, said:
MostwantedRBX, on 19 March 2014 - 10:58 PM, said:
local tData = setmetatable({"hello", "world"}, {
__call = function(t, i)
return t[i]
end
})
As stated, it allows you do do the followingprint(tData[1]) --# outputs: hello print(tData(1)) --# outputs: hello
Ah, I haven't learned to use metatables effectively yet. I'm keeping busy learning other languages, too, like Java, C++ and Python, so I haven't really had the time. It may be worthwhile to do so, though. I shoot from place to place, lol.
#34
Posted 21 March 2014 - 04:48 PM
MostwantedRBX, on 19 March 2014 - 11:19 PM, said:
theoriginalbit, on 19 March 2014 - 11:03 PM, said:
MostwantedRBX, on 19 March 2014 - 10:58 PM, said:
local tData = setmetatable({"hello", "world"}, {
__call = function(t, i)
return t[i]
end
})
As stated, it allows you do do the followingprint(tData[1]) --# outputs: hello print(tData(1)) --# outputs: hello
Ah, I haven't learned to use metatables effectively yet. I'm keeping busy learning other languages, too, like Java, C++ and Python, so I haven't really had the time. It may be worthwhile to do so, though. I shoot from place to place, lol.
#35
Posted 22 March 2014 - 12:22 AM
Apemanzilla, on 21 March 2014 - 04:48 PM, said:
Edited by theoriginalbit, 22 March 2014 - 12:23 AM.
#36
Posted 23 March 2014 - 03:59 PM
theoriginalbit, on 22 March 2014 - 12:22 AM, said:
Apemanzilla, on 21 March 2014 - 04:48 PM, said:
#37
Posted 29 March 2014 - 11:46 AM
Apemanzilla, on 21 March 2014 - 04:48 PM, said:
MostwantedRBX, on 19 March 2014 - 11:19 PM, said:
theoriginalbit, on 19 March 2014 - 11:03 PM, said:
MostwantedRBX, on 19 March 2014 - 10:58 PM, said:
local tData = setmetatable({"hello", "world"}, {
__call = function(t, i)
return t[i]
end
})
As stated, it allows you do do the followingprint(tData[1]) --# outputs: hello print(tData(1)) --# outputs: hello
Ah, I haven't learned to use metatables effectively yet. I'm keeping busy learning other languages, too, like Java, C++ and Python, so I haven't really had the time. It may be worthwhile to do so, though. I shoot from place to place, lol.
#38
Posted 29 March 2014 - 11:25 PM
ncfriend, on 29 March 2014 - 11:46 AM, said:
Edited by theoriginalbit, 29 March 2014 - 11:26 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











