I'm trying to get this bit of code to work with the lua.c32 interpreter: --- sample, the goal is to build a script that will allow me to enter a 4digit mt and load the bios iso accordingly print ("enter machine type :") mt = io.read() print ("you entered...",mt) doStuff() if (mt == "8141") then syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") end --- the problem is that lua kicks out an error every time "...attempt to call field 'read' ( a nil value)" --- this seems to work on the interpreter i installed on my linux box, but when i use it as a com32 it fails. --- boot: Lua.c32 /test/test.lua ---> runs lua script but fails on io.read() any help appreciated Thanks, ehouston3
On 05/09/2011 10:12 AM, e h wrote:> I'm trying to get this bit of code to work with the lua.c32 interpreter: > > --- sample, the goal is to build a script that will allow me to enter a 4digit > mt and load the bios iso accordingly > > print ("enter machine type :") > mt = io.read() > print ("you entered...",mt) > doStuff() > > if (mt == "8141") then > syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") > end > > --- the problem is that lua kicks out an error every time "...attempt to call > field 'read' ( a nil value)" > --- this seems to work on the interpreter i installed on my linux box, but when > i use it as a com32 it fails. > --- boot: Lua.c32 /test/test.lua ---> runs lua script but fails on io.read() > > any help appreciated >Hmm... I wonder if we simply fail to hook up the console APIs, or if we totally failed to bind io.read() at all; which seems odd... -hpa
Is there a way for me to re-compile the "Lua.c32" to include the "io.read()" function for my testing? I'm kinda new and have looked through the docs+ threads but, my "Makefile" doesn't recreate the "Lua.c32" I'm definately willing to give it a try. I've noticed that "read" error is on any of the scripts in the "lua/test/.." folder that contain the io.read() or io.input() functions... Regards, EH
I think the issue may be in "/lua/src/liolib.c" I saw a lot of commented out io_read and other read related functions. I'm guessing they weren't working properly. -EH ----- Original Message ---- From: e h <ehouston3 at yahoo.com> To: syslinux at zytor.com Sent: Mon, May 9, 2011 12:12:51 PM Subject: [syslinux] Lua.c32 - user input / scripting I'm trying to get this bit of code to work with the lua.c32 interpreter: --- sample, the goal is to build a script that will allow me to enter a 4digit mt and load the bios iso accordingly print ("enter machine type :") mt = io.read() print ("you entered...",mt) doStuff() if (mt == "8141") then syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") end --- the problem is that lua kicks out an error every time "...attempt to call field 'read' ( a nil value)" --- this seems to work on the interpreter i installed on my linux box, but when i use it as a com32 it fails. --- boot: Lua.c32 /test/test.lua ---> runs lua script but fails on io.read() any help appreciated Thanks, ehouston3 _______________________________________________ Syslinux mailing list Submissions to Syslinux at zytor.com Unsubscribe or set options at: http://www.zytor.com/mailman/listinfo/syslinux Please do not send private replies to mailing list traffic.