When writing a lua script for a module and wanting that to be applicable for multiple module types, it would be nice to have a way to address elements in a different- dynamic manner.
Adding a function that returns the highest numbered element would be neat as a start. This way one could always address the system element on all kinds of modules like so:
print(element[element_count()]:element_index())
-- for example this would return 12 on a PBF4 but 16 on an EN16
There could be a workaround with the length operator?
rint(element[element_count()-1]:element_index()) will return the element index of the system element. Available in nightly fw, use gec() instead of element_count() until if gets supported in grid editor!
When writing a lua script for a module and wanting that to be applicable for multiple module types, it would be nice to have a way to address elements in a different- dynamic manner.
Adding a function that returns the highest numbered element would be neat as a start. This way one could always address the system element on all kinds of modules like so:
There could be a workaround with the length operator?