Art Frank writes:
> I'm writing a command file that would accept input from a file and from the
> keyboard.
...
> What I have is a file containing a list of filenames to process. I want to
> read in a filename, ask a few questions about it, process the file, and read
> in the next filename.
While not the most efficient technique in general, a message file should work
nicely here.
The idea is to send your list of filenames to a message file (you know, with
CODE=MSG, so that each read is destructive, deleting the just-read record).
Then you could use a redirected :INPUT to read from the msg file, and a
separate :INPUT to read from the keyboard.
A sample code framework is this:
# load message file "msgfile" (code=MSG) with filenames,
# then...
#
while not finfo( "msgfile","eof" )
#
input filename < msgfile
input a1; prompt="Prompt 1:"
input a2; prompt="Prompt 2:"
#
# process here
#
endwhile
Regarding the previous comment about this technique's relative inefficiency,
it's because MPE must open/read/close msgfile each time its :INPUT statement
is executed.
Incidentally, I don't know how you're loading the list of filenames,
but if it's something that can be done via :listfile, you can use
build msgfile; temp; code=msg; rec=-254,1,v,ascii
file msgfile,oldtemp; dev=disc
listfile @.data,6 > *msgfile
or something similar.
--Glenn
.......................................................................
Item Subject: cc:Mail Text
|