#mute global function warn

17 messages · Page 1 of 1 (latest)

echo silo
#

i have a table of stuff where for each entry a function is called but since in that function i gotta use that table i must make it global, the problem is, when i call it, it shows a warn, and since its a long list there are MANY warns, is there any workaround for this
example:

local tab = {
something = dosomething(), --warns
othersomething = dosomething() --warns
}

function dosomething()
 return table.insert(tab, "something")
end
woeful tulip
#

but what is the warn?

echo silo
#

its weird cuz the formatter suggests it while typing

fickle trout
#

it's probably because the function is defined below where it's used

echo silo
#

but i think ill just make the table global

#

and put the function above it

#

for just 1 warn

fickle trout
#

there's no way to get rid of it

#

it's there for a reason

#

it's just bad structure

#

well technically you could disable warnings in the studio settings

#

but that doesn't make it any better

#

why don't you just make it a method of the table

echo silo
fickle trout
#

then mark it as private