А то чего-то в таком коде для IndexToChanel
func doEvent(_data)
fvar(old, cur, cr, il, im, ind, dt, i)
trace(block.cur()+" ???")
ind = e_int(Index)
dt = Data
if(expof(ind))
il = 0
cur = block.reggen()
trace(cur+" !")
old = block.select(cur)
for(i = 0; i < _event_count_; i++)
cr = block.reggen()
trace(cr+" !")
block.select(cr)
event("onEvent" + (i+1), dt)
if(not block.Empty())
block.select(cur)
if(il)
print(i, ': ')
else
im = i
end
lng.begin()
block.copyhere(cr)
lng.end()
il++
end
block.delete(cr)
trace(cr+" !!!")
end
block.select(old)
if(il=1)
print('if ', ind, ' = ',im, ' then ')
block.copyhere(cur)
else if(il>1)
println('case ', ind, ' of')
block.inclvl()
print(im, ': ')
block.copyhere(cur)
lng.end()
end
block.delete(cur)
trace(cur+" !!!")
else if((ind>=0)and(ind<_event_count_))
event("onEvent" + (ind+1), dt)
end
trace(block.cur()+" ???")
end