1 | local String = "Test String" |
2 | local Table = { 1 , 2 , 3 , 4 , 5 } |
How would I determine which variable stores what kind of data? Does that question make sense, or do I need to clarify?
Use the type()
method! So basically,
1 | local String = "Test String" |
2 | local Table = { 1 , 2 , 3 , 4 , 5 } |
3 |
4 | print ( type (String)) --> "string" |
5 | print ( type (Table)) -->"table" |
It returns a string of the name of your variable's data type. So when comparing:
1 | if type (String) = = "string" then -- right |
2 |
3 | if type (String) = = string then --wrong! |