I think that that's not valid as "in theory" he doesn't know the name of variables. I would try this:

ClassMethod Indirection()

    set TABLES(0)="EVEN"
    set TABLES(1)="ODD"
    for i=1:1:100
        set table = TABLES((i#2))
        set @table@(i)=

    zw @table
    set evenTotal=0
    set i=""
        set i=$ORDER(@table@(i)) QUIT:i=""  
        set evenTotal evenTotal+@table@(i)
    zwrite evenTotal

Hi Mathew,

that method doesn't return any info neither in case of error nor success... as you said, it always return "".

The option that Anderson mentions is a valid one to double-check that everything went well. 

A very simple approach  just in case... but  if ind is numeric you can try to get the first and  last ones with:

set first $order(^CacheTemp(repid,"MAIN","" ))

set last $order(^CacheTemp(repid,"MAIN","", - 1))

and then do the math to know how many entries (at most) there can be. 

We have several partners working on industrial sector that have mentioned that having support for OPC UA in IRIS would be great as it's becoming a de-facto stantard in their sector... I didn't dig much into technical details so far, but, based on your knowledge, would it be worthy to have it natively supported in IRIS or is using Java Business Hosts+external Java Library the better approach in this case?

OK. We're improving a bit.

I've changed Cache Terminal to CP850 which is the code page that Windows Powershell uses by default:

Now, any idea how could I make up-down keys work so to see the commands' history? Also, as Robert C. also mentioned… it seems that Ctrl-C quits not only from the command/function in execution but from Caché Terminal itself...