6.0 C/S read from file
; routine to copy data from a memory buffer into a RAF
; the entire memory buffer is copied (eg. we first do @Memory.beginning(A))
;
; A is the memory buffer
; B is ^RAF assumes [A,q]=data
; C tells us how to read data from the memory buffer
; C|0 = “R” to do @Memory.read.chars(A,C|1) (#mR)
; C|0 = “L” to do @Memory.read.line(A,C|1) (#mL) (if C|2, do @Text.out of data)
; C|0 = “Q” to do @Memory.read.text(A) (#mQ)
; if no C, do #mQ
; D tells us where to start writing data into the RAF (q number)
; if D=0, we kill the RAF first and start writing at q=1
; if ‘D, start writing at q=1 but don’t kill first (likely a new RAF)
; if D>0, start writing at D+1
;
@Memory.allocate(1)^MEM,
@Memory.clear(MEM),
@Memory.beginning(MEM),
@Memory.load.file(MEM,”V:\TEMP\users.txt”),
%Z.copy.mem.to.raf(MEM,^/FILE),
@Memory.clear(MEM),
@Memory.free(MEM),
“”^XX,DO{+/FILE[XX]^XX 1^/USERS[/FILE[XX]$10:0S]}