Subject: | |
From: | |
Reply To: | |
Date: | Thu, 16 Oct 1997 17:54:24 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
...
> >I understand that both programs
> > should read and write to the MSG file (until physically terminated).
> > Netbase does this OK, but the script reading the MSG file reads through
> > the file one time and then pauses. This is OK. However, the next time
> > that Netbase writes to the MSG file, the script terminates without
> > doing another read.
There have already been a couple of good suggestions. FWIW: the CI
opens and closes the file (any file) each time IO redirection is used.
This means how you write your script may have an impact. There are two
common ways to read a MSG file from the CI:
1) redirect the INPUT command, eg:
while FINFO('*MSGfile',eof') <> 0 do
INPUT var_buffer <*MSGfile
...
endwhile
2) redirect the script doing the reading, eg:
PARM ... entry=main
if '!entry' = 'main' then
...
# execute this script (hpfile) with input redirected from MSG file
xeq !HPFILE entry=readit <*MSGfile
...
elseif '!entry' = 'readit' then
# input redirected from MSGfile
while FINFO('*MSGfile','eof') <> 0
INPUT var_buffer
...
endwhile
endif
Note: I didn't test these script fragments so I'm not positive about the
FINFO line.
If you are reading an N record MSG file the first approach opens and closes
the file N times. The second method opens/closes it once.
regards,
Jeff Vance, CSY
--
|
|
|