Piorun Posted June 21, 2011 Posted June 21, 2011 Hi everyone. I've got one question. How to create a table for a function witch i create more than 1 label. For ex. I created a function where i have mysql result who returns a more than 1 rows. So my code in client-side: function blablabla(row1, row2) guiCreateLabel(0,0,100,10, row1.." "..row2, false) end I want this code be able with table for ex. function blablabla(row1, row2) labels = {} labels[1,2,3...] = guiCreateLabel(0,0,100,10, row1.." "..row2, false) end How?
h1ama3d Posted June 21, 2011 Posted June 21, 2011 function blablabla(row1, row2) lbl1 = guiCreateLabel(0,0,100,10, row1.." "..row2, false) lbl2 = guiCreateLabel(0,0,100,10, row1.." "..row2, false) lbl3 = guiCreateLabel(0,0,100,10, row1.." "..row2, false) labels = { lbl1, lbl2, lbl3, } end to hide all lables you can use for k,v in ipairs(labels) do guiSetVisible(v,false) end or if you want hide 1 label use guiSetVisible(labels[1],false)
Castillo Posted June 21, 2011 Posted June 21, 2011 I think this would be more efficient: labels = {} function blablabla(row1, row2) local newLabel = #labels +1 labels[newLabel] = guiCreateLabel(0,0,100,10, row1.." "..row2, false) end
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now