Posted 08 February 2013 - 03:31 PM
Hi
i tried to make my own adjustible menuprogram. it should basically be easy to add new menus and so on.
Therefore i ask the User in a Wizard about what function he wants to call and save that in a table.
That table i save into a file for later use.
To call the function i try to use "loadstring" but in almost every case it fails with
string:1: attempt to index ? (a nil value)
Sometimes it works though, alas it seems to me pretty random.
i also tried to use _G[string]() but i dont really get how itÄ's supposed to work :/
The complete code can be found here http://pastebin.com/HA1kPFgb
Also the error most certainly occurs in line 211/212
i also tried storing the string into a file and running it by calling it in shell.run, but it basically produces the same error, although i can run the file from the shell and the lua commandline, which utterly confuses me :/
i really have no idea why that is, so i hope for a good answer
Thanks
i tried to make my own adjustible menuprogram. it should basically be easy to add new menus and so on.
Therefore i ask the User in a Wizard about what function he wants to call and save that in a table.
That table i save into a file for later use.
To call the function i try to use "loadstring" but in almost every case it fails with
string:1: attempt to index ? (a nil value)
Sometimes it works though, alas it seems to me pretty random.
i also tried to use _G[string]() but i dont really get how itÄ's supposed to work :/
The complete code can be found here http://pastebin.com/HA1kPFgb
Also the error most certainly occurs in line 211/212
i also tried storing the string into a file and running it by calling it in shell.run, but it basically produces the same error, although i can run the file from the shell and the lua commandline, which utterly confuses me :/
i really have no idea why that is, so i hope for a good answer
Thanks