-- the atomic number of an element given by its symbol for _, name in ipairs({"O", "Fe", "Ni", "Gd", "U"}) do print(string.format("%-2s Z = %d", name, AtomNameToNumber(name))) end -- a symbol must be written as in the periodic table ok, message = pcall(AtomNameToNumber, "fe") print(message)