Accessing a collection in a script

 

Hi there.


I'm wondering if it's possible to access a collection as an array or table from a Lua script?


I've tried various types for --$input on my scrupt but I don't know if it even exists.

It would be great to do this as I'd then be able to inteerperet a great deal of values witha simple iterator!



   mrlargefoot

 
Profile Image
Eifert@Aximmetry
  -  

Hi,

Currently, Lua can not handle collection data types.

However, you can use an array compound to iterate through values in a collection. You could even use Lua script inside the array compound as the collection gets iterated through.
A short explanation on array compounds: https://my.aximmetry.com/post/2002-how-to-find-minimum-in-a-bunch-of-vector
Very specific documentation on arrays in collections and using array compounds with it: https://aximmetry.com/learn/tutorials/for-content-creators/collection-for-databases/#arrays-in-collections

Warmest regards,