Huseyin Kilic wrote:
-- loadsession.lua ------------------------------------------------------------
local sesFile = string.gsub(arg[1], "\\", "\\\\")
os.execute("c:\\tools\\win\\scite\\scite.exe \"-loadsession:"..sesFile.."\"")
Doh, I forgot Lua has os.execute... :-)
Note that lot of Lua users often overlook the literal strings, very
useful for regexes or Windows paths:
local sesFile = string.gsub(arg[1], [[\]], [[\\]])
os.execute([[c:\tools\win\scite\scite.exe "-loadsession:]] .. sesFile ..
[["]])
or
local sesFile = string.gsub(arg[1], [[\]], [[\\]])
local home = os.getenv("SciTE_HOME")
os.execute(home .. [[\scite.exe "-loadsession:]] .. sesFile .. [["]])
(untested)
It is slightly more verbose for the small strings, but a bit more
readable than all these backslashes.
I could also write '"', but with some fonts it isn't very readable either.
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest