Page 2 of 2

Re: Lua ??? - Record, fade selection

Posted: Thu Jun 11, 2009 6:12 pm
by TaineGilliam
I had a chance to look at your code - I'm learning a bit about List. I was unaware of the # operator for a list. Your parsing of the fixtures into the List is much cleaner than the code I stole from Brian's code for the ColorRange macro. I'm not sure about the added complexity to be sure each cue actually has NumCells channels - if math.random() return the same value a couple of time it may not matter. Otherwise we can do the list item delete on the master copy and move on.

As for performance, is the built in "table.remove(list, item_index)" better than "List.[item_index] = List.[NumFixtures]; Numfixtures=NumFixtures-1". Given that we don't need the list to survive and don't care about the order of items in the list. Or is my interpretation of List as an Array as a opposed to a List clouding my judgment. I really must read up on table.xxxx.

I think my pre-object oriented programming days(original Turbo Pascal) are starting to show.

Taine

Re: Lua ??? - Record, fade selection

Posted: Thu Jun 11, 2009 8:13 pm
by RobertBell
TaineGilliam wrote:As for performance, is the built in "table.remove(list, item_index)" better than "List.[item_index] = List.[NumFixtures]; Numfixtures=NumFixtures-1".
Yes - it would be for sure.
And you're right - we don't need to keep the original list - EXCEPT if the selection set is (say) 10, NumCells is 4 and NumCues is 100. Then we may want to keep it around.