Better LUA documentation

Discussions of Q-SYS hardware and software.

Moderators: Cameron Shoffner, Christian Cook, Kirk Fyvie, Martin Barbour, Fred Thomke, Gary Evans_QSC, Chris Brouelette

Fri Jan 27, 2017 5:01 am

  • Just wondering if there is better LUA documentation out there - specifically dealing with the properties and methods associated with the various components - for example, in a scriptable component, I cannot find documentation in the obvious places for how to add items to the list programaticaly.

    Also, if I have a group of components in the scriptable component (say buttons) how could I do an eventhandler for the lot which gives me the index of the button pressed?

    Help with these two small bits would be great - but a better way to help myself would be more appreciated.
    mac.calder
    Rookie
     
    Posts: 12
    Joined: Thu May 05, 2016 8:46 pm

Tue Feb 14, 2017 1:08 am

  • D'you mean how to add ListBox choices programmatically?

    that'd be:

    Code: Select all
    my_table = {}
    for i=1,4 do
      table.insert(my_table, "Option #" .. i)
    end
    Controls.MyListBox.Choices = my_table


    As for an event handler for a set of buttons, similarly:
    Code: Select all
    for i=1,#Controls.MyButtons do
      Controls.MyButtons[i].EventHandler = function(c)
        -- you can use "c" in here to refer to the button, and "i" to refer to the index
      end
    end


    I suggest reading up on general Lua documentation, such as the reference manual (https://www.lua.org/manual/5.3/).

    Cheers

    Michael
    gmichael225
    Possibly an old pro
     
    Posts: 26
    Joined: Fri Nov 06, 2015 1:59 am



Return to Q-SYS Support




Information
  • Users browsing this forum: No registered users and 1 guest