lua-users home
lua-l archive

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


Consider following modification. It uses the different meanings of '::' as label on the one hand and as comment on the other to construct different contexts:

::dummy--[[
@echo off
set f=%0
if exist "%f%" goto run
set f=%0.bat
if exist "%f%" goto run
set f=%~f0
if exist "%f%" goto run
set f=%~$PATH:0
if exist "%f%" goto run
for %%d in (%path%) do if exist "%%d\%0"    set
f=%%d\%0
if exist "%f%" goto run
for %%d in (%path%) do if exist "%%d\%0.bat" set
f=%%d\%0.bat
if exist "%f%" goto run
:run 
lua52.exe "%f%" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto :EOF
::--]]::

print( "hello lua" )



On Sat, Jul 12, 2014 at 10:47 AM, Xavier Wang <weasley.wx@gmail.com> wrote:
Hi,

I have found this archine:
http://lua-users.org/lists/lua-l/2006-09/msg00478.html

But, now, goto is a keyword for Lua, So the goto =goto is not work. Is
there other ways to make a Lua source file both a valid batch file?

--
regards,
Xavier Wang.