Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!lotus!patman From: patman@lotus.com (Pat Mancuso) Newsgroups: comp.lang.rexx Subject: Re: REXX, VM/CMS Message-ID: <1991Jan23.135615.20072@lotus.com> Date: 23 Jan 91 13:56:15 GMT References: <1991Jan22.022019.5280@ncsuvx.ncsu.edu> Sender: news@lotus.com Reply-To: patman@spice.lotus.com (Pat Mancuso) Organization: Lotus Development Corp. Lines: 41 In article <1991Jan22.022019.5280@ncsuvx.ncsu.edu> kirk@hobbes.catt.ncsu.edu (Kirk Krauss) writes: > >In article 388, Steve Siperas asks how to pull files successively >from a minidisk (in the VM environment). > ... > X = X + 1 > 'EXECIO 1 DISKR 'userid()' FILELIST A 'X ... > > Kirk > kirk@catt.ncsu.edu ACK! Don't do a diskr for each line of the result! That could take forever! There is a *much* more efficient way to do this: 'MAKEBUF' 'LISTFILE * * A (STACK FIFO NOH' line.0 = queued() do i = 1 to line.0 parse pull line.i end 'DROPBUF' This gets everything into line.i, but if you wanted to have 'em in separate variables you could do 'parse pull fn.i ft.i fm.i .' or something. If you really *have* to read in a bunch of lines from a file, use something like: 'EXECIO * DISKR' fn ft fm '(FINIS STEM LINES.' (the trailing dot is important, as EXEC2 isn't real bright...) Both of these result in the same thing: line.0 will be the number stem values that are valid, and line.1 -> line.(line.0) will be the contents of the lines of the file. -- Pat Mancuso - patman@lotus.com