Is there a way of converting a string to a table? or testing a variable passed to a function to see if it a string?
I have an App where I want provide a choice of themes, some are pre-defined and included in the source (tables) others will be downloaded as files in the future so my function needs to the following in psuedo code…
function loadTheme(themeName)
if themeName is a string then
load theme from directory – themeName is "newTheme.json’ or similar
else
theme = themeName --this is a table so point the global theme to it…
end
I’ve tried testing using the string functions but it gives an error if a table is passed
Help appreciated
PS has Gooogle search been turned off for Corona docs? I’m find it much harder to find anything this last week or so…