lua-users home
lua-l archive

Re: NEWBIE Question: LUA wait() function?

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


C/Invoke and the windows Sleep function? Just my 0ドル.02.

On Wed, Mar 12, 2008 at 10:45 AM, Jeff Pohlmeyer <yetanothergeek@gmail.com> wrote:
On Wed, Mar 12, 2008 at 3:26 AM, Rolf <rb@san.rr.com> wrote:
> Jeff,
> I have never used Wscript and know nothing about it.
> Anyway, I tried it almost exactly as you suggested:

> Function test()

You are aware that Lua is case-sensitive?

( should be function, not Function )

> However, nothing happened when running test()...?

Maybe try this:

function test()
local err
local vb="test.vbs"
local f,err=io.open(vb)
if err then
msgbox(err)
return
end
f:write("WScript.Sleep(1000)\n")
err=f:close()
if err then
msgbox(err)
return
end
for i=1,10 do
msgbox("Execute=".. (os.execute(vb) or "unknown"))
end
end


- Jeff


AltStyle によって変換されたページ (->オリジナル) /