Table & Dictionary
✏ Beginners Scripting Guide ✏
In this section, we will be discussing tables and dictionaries. A table can be used to store data inside and a dictionary is a key with a value in the table.
CREATING A TABLE
First, we are going to make a variable and we gonna store curly brackets in that variable
PUTTING DATA INTO THE TABLE
Now, we are going to put some data into a table. In this example, I will be using string.
GETTING DATA INSIDE THE TABLE
To get the data inside the table, we have to index it out by getting the table, using the square brackets, and indexing it out with numbers.
GETTING THE TABLE LENGTH
To get the amounts of how many arrays are in the table. We can use the # symbol to see the number of arrays in the table.
CREATING A DICTIONARY
To make a dictionary we will create a new table.
INSERTING KEYS
Now we will give the key a name and assign data to it.
When you create a key with space or number you must use square brackets and a string.
GETTING THE KEY DATA
Now, we can get the data by using the dictionary, using square brackets or a period, and then indexing the key name.
You can use a period for non-space or non-number dictionary key names but you have to use square brackets for the key name with a number or space in its name.
Last updated