Advertisement
janac

argument is nil inside function in table

Jan 1st, 2025 (edited)
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. monitor={
  2.     left_margin=3,
  3.     top_margin=3,
  4.     line_height=7,
  5.     lines={},
  6.    
  7.     new=function(self,tbl)
  8.         tbl=tbl or {}
  9.         setmetatable(tbl,{
  10.             __index=self
  11.         })
  12.         return tbl
  13.     end,
  14.    
  15.     add_line=function(self,lin)
  16.     printh("in add_line, lin="..lin,"bugfile.txt")
  17.         add(self.lines,lin)
  18.     end,
  19.    
  20.     draw=function(self)
  21.         for i=0,#self.lines-1 do
  22.             print(self.lines[i+1],left_margin,top_margin+i*line_height,7)
  23.         end
  24.     end
  25. }
  26.  
  27. eoum=monitor:new()
  28.  
  29. eoum.add_line("finalbx:"..bl.x)
  30.  
  31. eoum:draw()
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement