Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Solved by incapaxian] Converting a "Key" of a Dictionary to String?

Asked by 5 years ago
Edited 5 years ago

Since I'm tired, it's 4:40 AM and I can't seem to figure out a solution...

I bothered myself to beg the question, "How could I get a string from a key in a dictionary"

Here is my current code:

local functions = {}
        local function searchTable(tab,nam)
            local parent = ""
            for i,v in pairs(tab) do
                if CVExtra[tab] then
                    parent=""..nam
                else
                    parent=""
                end
                if typeof(v)=="function" then
                    table.insert(functions,""..i)
                elseif typeof(v)=="table" then
                    searchTable(v,i)
                end
            end
        end
table.insert(functions,""..i)

Trying to convert "i" to a string, which might equal "numbify" but "numbify" is a function, defined within the dictionary of "CVExtra."

print(i) is able to print out the name, but I don't know how to do the same.

I wonder if any one can provide the print() function code if no true solution can be made.

0
Don't get your question. `for k, v in pairs(dictionary) do end` the key is k. User#24403 69 — 5y
0
No like, I am trying to turn that "key" into a string that I can use Cvieyra2test 176 — 5y
0
the name of the key Cvieyra2test 176 — 5y
0
tostring(key) User#24403 69 — 5y
0
Had done it with the value and abandoned it, didn't think about using it for index. Thank ye' Cvieyra2test 176 — 5y

Answer this question