Discussion (7)1
Log in or sign up to continue

This only matters for very long loops (and you'd need a pretty extreme scenario for it to matter even then), but a post-conditional 'quit' is only meaningful if there's more code after it, and it comes with a performance cost, so this line:

USER>for count = count:1 set ref=$query(@ref) quit:ref=""

...should be:

USER>for count = count:1 set ref=$query(@ref) if (ref="") quit