Questions tagged as 'lua'

2
answers

IupLua - Position component

In IUPLua, how do I position a component indicating X (horizontal position) and Y (vertical position)? I read in the documentation:    It will be changed during the layout computation, except when   FLOATING = YES or when used inside a concre...
asked by 08.01.2015 / 17:24
1
answer

How to iterate with a Table in Lua? [duplicate]

How to iterate with a Table in Lua ? Example: dados = { nome = 'Wallace', idade = 25 }     
asked by 10.12.2015 / 16:07
1
answer

Send mail via moon

I want to send a simple email on Lua, I used the example in official documentation , and returns me always nil . Example: -- load the smtp support local smtp = require("socket.smtp") from = "<[email protected]>" rcpt = { "...
asked by 13.07.2015 / 17:56
1
answer

Loadstring, how to use?

I'm using the loadstring function, but I do not know if this is the right way: a= "st = {b=1, c=2}" st = {} b = loadstring(a) b() print(st.b) Is there any simpler way?     
asked by 22.11.2014 / 04:33
1
answer

What would be the correct way to check if a value exists in the table in Lua?

if not name in Namez do table.insert(Namez,name) end What would be the correct way to check if a name is not in the table?     
asked by 27.10.2018 / 17:02
1
answer

Lua language typing strength

Moon has dynamic typing, but after all, is it strongly typed or weakly typed? Each source I consult has a different information, which left me in doubt.     
asked by 25.04.2018 / 04:34
1
answer

Convert String to Tables

local items = {} local t = "7 2182, 4 2554, 5 9908" I wanted to convert using this string and let the table go like this: local items = {{7,2182},{4,2554},{5,9908}} Is there a way? using gsub maybe?     
asked by 12.03.2017 / 01:02
1
answer

Show a specific number of decimal places in floating-point numbers in the Lua language

I started learning a little about the language Lua and I'm doing some algorithms to practice and one of them should show in the output of the floating point values with 4 decimal places. In C ++ I would use cout << fixed << setpre...
asked by 08.08.2016 / 22:28
1
answer

Check in the URL if it has a variable passed GET LUA

I want to check through the URL if I have any variables passed to via GET . For example in this url: www.exemplo.htm?teste=teste if url then -- se na barra de endereço tem um get return true else return false end I have a...
asked by 18.05.2015 / 18:17
1
answer

How to get only a part of a string from a pattern?

I have a string in Lua language. I want to get only the filename part through match ( 403.htm.en ). Example: var=[[Content-Disposition: attachment; filename="403.htm.en" Content-Type: text/plain; name='403.htm.en'...
asked by 30.07.2015 / 18:59