I managed to use CacheGlobalOrder to iterate over global and return the next subscript:
int GetGlobalStr(char *global, int subscript, CACHE_EXSTRP result)
{
int push = CACHEPUSHGLOBAL(strlen(global), global);
int pushS = CACHEPUSHINT(subscript);
// narg Number of subscript expressions pushed onto the argument stack.
int narg = 1;
// Direction for the $Order is 1 for forward, -1 for reverse.
int dir = 1;
// Indicates whether the data value, if there is one, should be returned.

.png)

After many sleepless nights it's a pleasure to announce the newer, better, moderner ObjectScript compiler which implemented pretty much everything you ever wanted to have in 
