Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/11/14 in all areas

  1. Sol

    Lua question

    'c' argument is something like a class or struct pointer like in 'C' LUA doesn't have classes but it's something like it, also you can implement prototype of any variable to this kind of structure to keep unique variable name and get access from that self pointer. Here is the explanation: http://www.lua.org/pil/16.1.html
    1 point
  2. Zelly

    Lua question

    c would be the DB if I am correct. (not sure if this the correct format for rewriting that piece of code, but it might help you understand it) if you do DB:Connect("dbname", "dbuser", "dbpassword", "dbhost", 3306) then you are really doing DB.Connect(DB,"dbname", "dbuser", "dbpassword", "dbhost", 3306) function DB.Connect(self,DBName, DBUser, DBPass, DBAddr, Port ) -- so self is actually the DB table require "luasql.mysql" self.env = assert( luasql.mysql() ) self.con = assert(self.env:connect(DBName, DBUser, DBPass, DBAddr, Port)) end Disclaimer: I do not fully understand this part of lua yet, so I may have made a mistake.
    1 point
×
×
  • Create New...