• Announcement: Lua.org now officially recommends this forum as a meeting place for the Lua community

Lua is setting a valid table entire to nil (1 Viewer)

joaocarvoli

Newcomer
Joined
Mar 16, 2022
Messages
3
Reaction score
0
Location
Fortaleza- CE ( Brazil )
Hi everyone, I have this trouble. I want to set a table to transform it into JSON format for then to send it in an HTTP request. The question is that I discovered that for a reason, a table setting by me is like nil. I don't know why but someone would explain more about this?

Code:

*The Content is a string*
1647460659690.png
Debug:
1647460812064.png
 

stetre

Member
Rank: II
Joined
Jan 8, 2020
Messages
103
Reaction score
58
Location
Italy
Website
github.com
Inconsistent variable names in the for loop. First you assign the values returned by pairs( ) to the names 'k' and 'v'. Then you reference them with the names 'key' and 'value' (the latter, being uninitialized, are nil).
 
Top