Andreas Rozek Hints for Reading List of Recent Changes Guestbook Entry Contact the Author  Deutsche Version  HomePage Previous Topic Next Topic  First Page of Current Topic Next Page Previous Page

Lua_00 - a first simple Lua Script

"Lua_00" demonstrates the invocation of Lua scripts and tests the proper handing over of any given command line arguments.

The program itself is extremely simple and therefore does not require any further explanation. Upon an invocation of the form

  lua Lua_00.lua one_word "multiple words" "multiple words with \" in between"

the program produces the following output:

  Lua_00 - lists the given command line arguments

  got 4 arguments:
    1) "Lua_00.lua"
    2) "one_word"
    3) "multiple words"
    4) "multiple words with " in between"

If invoked without any command line parameters

  lua Lua_00.lua

it simply shows:

  Lua_00 - lists the given command line arguments

  got one argument:
    1) "Lua_00.lua"

Source Code

The source code of this example is available for download:

References

[1] Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes
Reference Manual of the Programming Language Lua 4.0
(see http://www.lua.org/manual)
the official reference manual contains any relevatn information about the language itself, the set of standard libraries and its interface to the run-time environment;

Disclaimer

Please, consider also the author's Disclaimer!

http://www.Andreas-Rozek.de/Lua/Acquainting/Lua_00_en.html    (last Modification: 15.04.2002)