/ HALion Developer Resource / HALion Script / Reference /

findSlots

findSlots(nameOrFilterFunction)

Description

Function to find the slots of the plug-in instance. Before calling this function you must access the Instance object with this.program.instance. The function returns an array with the Slot objects of the found slots. Particular slots can be searched by name or through a filter function. If searching by name, findSlots accepts only the Slot objects that match the specified name. The filter function uses the Slot object of each slot as argument. Only those Slot objects that return true for the search criteria defined in the filter function will be accepted by findSlots. Without a name or filter function the Slot objects of all slots in the instance will be returned.

Available in: Controller, Processor.

Arguments

ArgumentDescriptionValue Type
nameOrFilterFunctionThe name of the slots searched for or a filter function. Only the Slot objects that match the name or return true for the search criteria of the filter function will be accepted. Set this to nil to deactivate any name filter or search criteria.string or function, optional

Return Values

Returns an array with the Slot objects of the found slots. Returns an empty table if no slots are found.

Example

-- Print the names of all slots.

slots = this.program.instance:findSlots()
  
for i, slot in ipairs(slots) do
        print(slot.name)
end

See also: findBusses, findChildren, findEffects, findLayers, findMidiModules, findZones, Slot