lua-users home
lua-l archive

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


On 11/09/2011 3.00, Jeff Pohlmeyer wrote:
On Sat, Sep 10, 2011 at 6:09 PM, Phillip Richcreek wrote:
I'm unable to see the script's PRINT output.
How can I make double-clicking a .lua file bring up a cmd window that
doesn't immediately disappear?

For develoment/debugging purposes it might be helpful if the
window stayed open. But for a script written for everyday use,
many people would prefer something that does what it needs to
do and then gets out of the way. For the best of both worlds,
during development you could add this to the end of the script:


   print("Press [Return] to exit")
   io.read()


To improve on this you could do the following:

After setting the command for .lua files association as:

"path\to\lua\lua.exe" -e"CALLED_FROM_WIN_SHELL=true" "%1"

at the end of the script put:

if CALLED_FROM_WIN_SHELL then
    print("Press [Return] to exit")
    io.read()
end


  - Jeff




-- Lorenzo