How to Read Program Arguments in Lua

Tue, Oct 25, 2016

Read in 1 minutes

Lua is among the programming languages - that I write about here - I have used the least.

Reading program arguments is as easy as in most languages.

for i=1,#arg,1
do
  print(arg[i])
end

First we loop from 1 to the count of elements in arg (#arg).

In the do block we just print each argument.

See Also

How to Read a File in Lua

Fri, Oct 28, 2016

Read more →

How to Read program arguments in Lisp

Tue, Nov 24, 2015

Read more →

How to Read Program Arguments in Perl

Sat, Aug 15, 2015

Read more →

How to Read Program Arguments in PowerShell

Sat, Aug 15, 2015

Read more →

How to Read Program Arguments in C#

Fri, Aug 14, 2015

Read more →