lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I met this problem one month ago. I think it is the problem of IUP 2.7. Please try IUP 3.0, so far as I know, there is no such problem.

Best Regards,

Bo


J.Jørgen von Bargen a écrit :
Problems with IupLua, wlua.exe and arguments passing.

>I have several questions and issues concerning IupLua and LuaForWindows but
>  I'm not sure, if this is the right place.
Well, there will be no problem discussing it here, given that we don't
actually have a forum for LfW (yet)
Ok then let's go. Issue number one (I'll split my issues and send them one by one):

To show up the problems, I wrote the following script:

-=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=-
require"iuplua"
local lines={}
for k,v in pairs(arg) do
    lines[#lines+1]=string.format("arg[%d]=%q",k,v)
end
lines=table.concat(lines,"\n")
iup.Alarm("Show Args",lines,"OK")
-=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=-

When I invoke the script with "wlua ShowArgs.wlua" everything is fine.
When I add some arguments "wlua ShowArgs.wlua ONE TWO THREE", nothing happens.
Wlua seems to exit silently without any error message at all.

I have changed the script to

-=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=-
local lines={}
for k,v in pairs(arg) do
    lines[#lines+1]=string.format("arg[%d]=%q",k,v)
end
lines=table.concat(lines,"\n")
arg={}
require"iuplua"
iup.Alarm("Show Args",lines,"OK")
-=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=-

Now everything is works, even with arguments.
It seems, the require"iuplua" triggers an argument evaluation.
Is this a bug? Or a feature? How can I pass arguments to my script without dirty tricks? (Using the standard "wlua ShowArgs.wlua -- ONE TWO THREE" does not help either.

Regards Jørgen

PS: Everything based on LuaForWindows_v5.1.4-30