• Records
    3 replies, posted
I have been programming in c++ for a year now just wondering if you can use records in lua as I looked online but found nothing about records.
Not sure if I'm right or not, but I think the closest thing (in Lua) is [URL="http://www.lua.org/pil/2.5.html"]tables[/URL]... Note I have NO knowledge whatsoever of C++, so I'm probably completely wrong. If I am wrong, could you give a rough explanation of what records are? By the way, I searched 'Lua records' and the first thing that came up was this other [URL="http://www.lua.org/pil/3.6.html"]Lua table tutorial thing[/URL], so tables are probably similar to records...
[QUOTE=MPan1;49710460]Not sure if I'm right or not, but I think the closest thing (in Lua) is [URL="http://www.lua.org/pil/2.5.html"]tables[/URL]... Note I have NO knowledge whatsoever of C++, so I'm probably completely wrong. If I am wrong, could you give a rough explanation of what records are? By the way, I searched 'Lua records' and the first thing that came up was this other [URL="http://www.lua.org/pil/3.6.html"]Lua table tutorial thing[/URL], so tables are probably similar to records...[/QUOTE] I think it's more like SQL. gmod supports sql by default, and can have mysql support with a c++ binary.
If you're talking about [url=http://jcsites.juniata.edu/faculty/rhodes/cs2/ch05a.htm]this kind of records[/url], we don't natively have them, but you can use one of many OOP lua implementations to do it. But keep in mind that you [b]CAN'T[/b] enforce datatypes, this is a non-typed language and as such there're ways to go around any implementation you try to do if they could do it.
Sorry, you need to Log In to post a reply to this thread.