--****************************************************************************** --* * --* File: Lua_00.lua Revision: 1.0 * --* * --* Contents: first experiments with Lua 4.0 * --* * --* Creation: 28.02.2002 Last Modification: 28.02.2002 * --* * --* Platform: IBM-compatible PC running Windows 98SE * --* * --* Environment: Lua 4.0, TkLua 4.0 * --* * --* Author: Andreas Rozek Phone: ++49 (711) 6770682 * --* Kirschblütenweg 15 Fax: - * --* D-70569 Stuttgart EMail: Andreas.Rozek@T-Online.De * --* Germany * --* * --* URL: http://www.Andreas-Rozek.de/ * --* * --* Copyright: the software is published under the "GNU Lesser General Pub- * --* lic License" (see "http://www.fsf.org/copyleft/lesser.html" * --* for additional information) * --* * --* Comments: (none) * --* * --****************************************************************************** print(); print("Lua_00 - lists the given command line arguments"); print(); local ArgList = getargs(); local ArgCount = getn(ArgList); if (ArgCount == 0) then print("(no arguments given)"); else if (ArgCount == 1) then print("got one argument:"); else print("got "..ArgCount.." arguments:"); end; for i = 1,ArgCount do local Argument = tostring(ArgList[i]); if (strlen(Argument) > 70) then Argument = strsub(Argument,1,67).."..."; end; print(format(" %2d) \"%s\"", i, Argument)); end end; exit();