lua-users home
lua-l archive

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


goto =goto

--[[ with my batch script io 
redirection '<' & '>'
will work 99.9999999999% guaranteed
]]

io.write("hello universe, again!\n")
io.write("your name:")
s = io.read()
io.write("hi ",s,'\n')

--[[ with my batch script you can pass your
own personal environment variable ]]

print('User='..os.getenv('User'))

--[[ or you can decide to where will
be the module be loacated ]]

print('LUA_PATH='..os.getenv('LUA_PATH'))
-- LUA does not have PUTENV!

--[[ or run other program before and/or after
running lua see batch script below ]]
os.execute('cd c:')

--[[ or you can run Lua without showing
the console!, well, atleast minimized console
window using this command:
%comspec% /C start /MIN lua.exe "%f%" %1 %2 %3 %4
%5 %6 %7 %8 %9
]]

--[[
You cant do all the above using
file association (without using several script).

srLua is bulky!, Lua version dependent & needs to
be built

This batch script will run in all Win32 OS

My only request is the '@' char
and the -S option like in perl

(... i think theres only few Win32 lua users)
]]

--[[
:=goto
@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
	set User=God
	set LUA_PATH=c:\whatevr_dir;e:\;f:\lua\lib
	cd "%windir%"
	
	lua.exe "%f%" %1 %2 %3 %4 %5 %6 %7 %8 %9

	pause
::]]


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com