lua-users home
lua-l archive

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


Yes, typo in my E-mail. I used function test().

Running the script below, I got the error:
Test.vbs: no such file or directory.

I was actually wondering about this. Is the file supposed to be written to
the hard drive somewhere?

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Jeff Pohlmeyer
Sent: Wednesday, March 12, 2008 1:45 AM
To: Lua list
Subject: Re: NEWBIE Question: LUA wait() function?

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