LIMIT

This tutorial is specific to our newest product, Hudl Sportscode. If you’re on Sportscode v11, use these resources instead or upgrade today.

This script will lim­it instances based on conditions.

FORMAT: instances LIMIT offset, select or instances LIMIT select


ARGUMENTS:

  • Instances: Quot­ed text, spec­i­fy­ing the label you wish to count in the front time­line or instances (which can be grouped using OR, AND, NOT).
  • Off­set: The off­set to start count­ing (e.g., 1 = will skip the first instance). If off­set < 0 then it will count from the end (e.g., -1 = will skip the last instance). This can be left out if the off­set is 0.
  • Select: The number of instances to select. If it is set to select < 0, it will select up to the end val­ue (-1 = last, -2 = second to last, etc.)

EXAMPLE 1

$var = instances limit 2
show count $var

This will grab the first two instances.

EXAMPLE 2

$var = instances limit 4, 2
show count $var

This will off­set four instances and select the next two, showing the fifth and sixth instances.