TL;DR: Is there any way in the Aurora scripting system to pass function arguments – other than objects – by reference rather than by value? Or write a custom
GetNext function pair?
Thing functions use internal per-user context storage to keep track of where they are in the list, with the context initially set up by the
GetFirst call. In normal coding, this is re-entrant and can cause problems. (Think about a
GetNext loop that calls a function that does a separate
GetNext loop on the same object. I haven’t tried it, but I wouldn’t be surprised if it messed up.)
One avoidance approach is to make the caller responsible for keeping the context, rather than having it stored internally by the functions. So
GetFirst sets it up and returns it, and that context variable gets passed to each related
GetNext call, which updates it. This requires pass-by-reference semantics, but other than objects I haven’t found any way to use PBR. Is there one?