Question
· Jun 25

How to send WRITE formatted output to a variable

I'm trying to keep all writes in local memory.

If you have    S %A="""HI THERE"",!,#,33.33,"" "",$ZTIMESTAMP"

and you         O 2 U 2 W @%A C 2 ZW ^SPOOL                    
^SPOOL(1,1)="HI THERE"_$c(13,10)
^SPOOL(1,2)=$c(13,12)
^SPOOL(1,3)="33.33 67016,59246.6188873"

It works just fine and the output is in the ^SPOOL global. 

However, I'm trying to avoid writing to disk.

I can't find anything besides using the SPOOL device that will allow the use of the "@" indirection.

I tried using streams but it will not allow @indirection.  Neither will set, or execute, or anything.

Is there any easy way to just set a variable to the formatted write output that the @indirection creates??

Thanks!

Product version: IRIS 2022.1
Discussion (4)2
Log in or sign up to continue