generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: What is a table?

Previous Thread :: Next Thread 
GNUnotUNIX is not online. GNUnotUNIX
Joined: 05 Feb 2012
Total Posts: 15171
09 Mar 2017 09:35 AM
Is a table a 1 dimensional array that also behaves like a class?


Report Abuse
Customality is not online. Customality
Joined: 11 Aug 2015
Total Posts: 590
09 Mar 2017 09:38 AM
Yes.
Report Abuse
GNUnotUNIX is not online. GNUnotUNIX
Joined: 05 Feb 2012
Total Posts: 15171
09 Mar 2017 09:41 AM
Ok.


Report Abuse
AxonMega is online. AxonMega
Joined: 29 Aug 2014
Total Posts: 2403
09 Mar 2017 09:42 AM
Tables are data structures that behave like objects and can be arrays of any dimension or dictionaries, or even both at the same time.
Report Abuse
GNUnotUNIX is not online. GNUnotUNIX
Joined: 05 Feb 2012
Total Posts: 15171
09 Mar 2017 09:44 AM
Although you can simulate a table to be a multi dimensional array by putting multiple 1 dimensional tables in a table, I'm pretty sure that doesn't mean they are multi dimensional.

Also what do you mean with dictionaries?


Report Abuse
AxonMega is online. AxonMega
Joined: 29 Aug 2014
Total Posts: 2403
09 Mar 2017 09:50 AM
What's the difference between simulating a multi-dimensional array and being one?

Also, dictionaries are tables in which the keys are more than just integers. They can be strings, booleans, and I think every other type of data in Lua except nil.

Example:

dictionary = {
[true] = false,
["Cat"] = "Dog",
[12] = 24
}
Report Abuse
GNUnotUNIX is not online. GNUnotUNIX
Joined: 05 Feb 2012
Total Posts: 15171
09 Mar 2017 09:52 AM
@Axe
Not much, except that one is easier to create and is a bit more optimized.

And thanks for the explaination.


Report Abuse
AxonMega is online. AxonMega
Joined: 29 Aug 2014
Total Posts: 2403
09 Mar 2017 09:58 AM
Welcome.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
09 Mar 2017 02:08 PM
"Is a table a 1 dimensional array that also behaves like a class?"
No. It's far more generic than that.

A table is really just hash map in which keys can be any Lua value other than nil. They are optimized for array usage, however (values in integral keys from 1 to n are typically in the array part which makes it faster to read and write to).
Report Abuse
TallAwesomeGuy98 is not online. TallAwesomeGuy98
Joined: 26 Mar 2012
Total Posts: 26793
09 Mar 2017 02:10 PM
^


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image