Hi everybody!
I'm such a noob in LUA/FAR macro system
So.
I like to call a LUA script-file "myscript.lua" from commandline (for example), and like to pass some arguments to it.
How I can get values of the passed arguments in "myscript.lua"?
I tried "arg[1]" which is nil and read whole luafar_manual.chm & macroapi_manual.en.chm + I read all the internet but I did not get an answer. Seems Google is not my friend?
Thanks for your help!
How to get arguments of lua:@myscript.lua 1,"two",3 ?
-
- Posts: 23
- Joined: Mon 12 Aug, 2013 14:03
- Has thanked: 6 times
-
- Posts: 6834
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 530 times
Re: How to get arguments of lua:@myscript.lua 1,"two",3 ?
You can get the arguments the following way:
If you want them in a table:
To find out how many arguments there are:
local a,b,c = ...
If you want them in a table:
local arg = {...}
To find out how many arguments there are:
local narg = select("#", ...)
-
- Posts: 23
- Joined: Mon 12 Aug, 2013 14:03
- Has thanked: 6 times
Re: How to get arguments of lua:@myscript.lua 1,"two",3 ?
Thank You both for the light-speed answers!
OK, now I feel like I will do hypercomplex plugins for FAR
OK, now I feel like I will do hypercomplex plugins for FAR