**************************************************************************
*                                                                        *
*    This script demonstrates file I/O in scripts.                       *
*                                                                        *
**************************************************************************
*
Declare S1 String
*
Open 1 'pibterm.pre' input
*
If ( IOResult = 0 ) THEN
   Message 'Opened pibterm.pre OK'
Else
   Message 'Could not open pibterm.pre'
Endif
*
Open 2 'pibterm.boz' append
*
If ( IOResult = 0 ) THEN
   Message 'Opened pibterm.boz OK'
Else
   Message 'Could not open pibterm.boz'
Endif
*
Writelog 'Contents of file PIBTERM.PRE'
Message 'Contents of file PIBTERM.PRE'
Message ' '
*
While ( NOT Eof( 1 ) ) Do
   Readln 1 S1
   Message S1
   Writeln 2 S1
   Writelog S1
Endwhile
*
Close 1
Close 2
Writelog 'Finished prefix stuff'