How I can convert / get Array or Dictionary name into string?
local First = {1,2,3}; local Second = { fruit = lemon, sour = true, }
So name of Array, is “First”, and the name of Dictionary is “Second”
But this won’t be equal:
First == "First"
How I can get name of this tables?
I don’t think there’s any purpose of detecting the dictionary name, since you can just “First” On it. Can you tell us what’s your plan why do you need to get the dictionary name?
Other thing that may be similar
You can use for loop
and use an if statement
to get the name of the index
There is no way or reason to get the variable name
It would have to be a key in the dictionary for you to do something like that
There are no programming languages that are able to cast a variable’s name to string. And i have no idea why you would want to do that
Tables don’t have names but what’s stopping you from doing First == First
For what I was need it - I’m create Crafting menu, in which Dictionary name = recipe name, and this name used to get icon for GUIbutton.
Just add a key/field to the dictionary named “Name” and have its associated value represent the name of the dictionary, for example;
local Dict = {["Name"] = "Dict"}
print(Dict.Name) --Dict