Top "Lua" questions

Lua is a powerful, fast, lightweight, embeddable scripting language.

Most efficient way to determine if a Lua table is empty (contains no entries)?

What's the most efficient way to determine if a table is empty (that is, currently contains neither array-style values nor …

lua lua-table
How to get list of directories in Lua

I need a list of directory in LUA Suppose I have a directory path as "C:\Program Files" I need …

lua filenames directory-listing
Lua replacement for the % operator

I want to check, if a number is divisible by another number: for i = 1, 100 do if i % 2 == 0 then print( i .. " …

math lua modulo
How to create include files in Lua language?

I want to create a header file in Lua (header.lua), then execute the require function to load it. How …

header lua require
How do you copy a Lua table by value?

Recently I wrote a bit of Lua code something like: local a = {} for i = 1, n do local copy = a -- …

lua lua-table
Lua - if statement with two conditions on the same variable?

How can I set a lower and upper bound value for a variable in a if-statement in lua programming language? …

if-statement lua coronasdk
Lua - get command line input from user?

In my lua program, i want to stop and ask user for confirmation before proceeding with an operation. I'm not …

lua user-input blocking wait
Check if a file exists with Lua

How can I check if a file exists using Lua?

file-io lua file-exists
interactive lua: command line arguments

I wish to do lua prog.lua arg1 arg2 from the command line Inside prog.lua, I want to say, …

command-line lua interactive
How to exit a Lua script's execution

I want to exit execution of Lua script on some condition . Example : content = get_content() if not content then -- ( …

lua