21.12.2025, 13:13
(This post was last modified: 21.12.2025, 16:45 by CristianAgata.)
(21.12.2025, 11:37)admin Wrote:Code:t = {}
for i = 1, 10 do
t[ i ] = {}
end
log(t[ 2 ])
Thanks but I don't explain myself very well, this my situation:
I have
name = {'Tv_1','Tv_2','Tv_3'}
number_entry = 3
entry = {[1] = {['component'] = 'switch'}, [2] = {['component'] = 'audioVolume'}, [3] = {['component'] = 'audioMute'}}
result must be a table as this:
new = {{[Tv_1] = {['component'] = 'switch',['component'] = 'audioVolume',['component'] = 'audioMute'}, [Tv_2] = {['component'] = 'switch',['component'] = 'audioVolume',['component'] = 'audioMute'}, [Tv_3] = {['component'] = 'switch',['component'] = 'audioVolume',['component'] = 'audioMute'}}
in this way in a second part of script when I will call
object = new.Tv_1[1] I will give switch
Best regards Cristian
