A function iterates global ^data(a,b,c) with $order using 3 nested for-loops. At certain point, for example with a=10, b=20, c=30, the function exits and later has to resume the iteration from the same point. What could be easiest way for it? My solution looks too ugly.
You could try using $QUERY to iterate the global and use $QLENGTH to determine how deep you are and $QSUBSCRIPT to determine what the subscripts are.