Sorry, but I have next question.
(Yes, now i read docs and, I hope, did not miss the answer there again ^_^)
It strongly related to my previous thread.
if red['signal-N'] then
local N = red['signal-N']
out['signal-' .. N] = 1
end
What should we do with N > 9
?
Name signal-23
is valid signal name?
(Not in vanilla. Yes if something like "Schall Virtual Signal" installed. Not if this disabled in it's setting…)
How to detect it?
Code like this for invalid N
just makes error:
if red[N] ~= nil then
out[N] = 1
else
out['signal-0'] = 1
end
Now I use pcall
for catch it:
if pcall(function() local r = red[N] end) then
....
Its work.
But… Is this the only way?
Maybe there is a simple (and correct) method that I don't see?