Jump to content

table.insert QUESTION


Hero192

Recommended Posts

It inserts a new item in the table.
local messages = {'First message'} 
table.insert(messages, 'Second message') 
table.insert(messages, 'Third message') 

Or this way storing all datas in one function to avoid repeating

local messages = {'First message'} 
table.insert(messages, {'Second message','Third message'}) 

Edited by Guest
Link to comment
It inserts a new item in the table.
local messages = {'First message'} 
table.insert(messages, 'Second message') 
table.insert(messages, 'Third message') 

Or this way storing all datas in one function to avoid repeating

local messages = {'First message'} 
table.insert(messages, {'Second message','Third message'}) 

meh, that would be

local messages = {'First message'} 
for u,sk in ipairs ( {'Second message','Third message'} ) do 
    table.insert(messages,sk) 
end 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...