home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rio111.zip
/
example3.nrx
< prev
next >
Wrap
Text File
|
1996-07-18
|
1KB
|
48 lines
/* A simple netrexx program, demonstrating the
use of charout, linein, lineout, delete
and stream. */
import RXFile
File1 = RXFile()
File2 = RXFile()
stdin = RXFile()
ok = Rexx null
say ' '
say 'This program creates a copy of an existing'
say 'ASCII file, stripping away lines starting'
say 'with the keyword REM (as in comments).'
say 'The result file is placed in this directory,'
say 'under the name TEMP.TXT.'
loop until ok.length() \= 0
say ' '
say 'Please enter a valid file name..'
say ' '
say 'Example: c:\\config.sys'
say ' '
File1.charout("File name>")
ok = stdin.linein()
if (File1.stream(ok,"c", "query exists")).length() = 0 then
do
ok = ""
say "That file doesn't exists."
end
end
File2.delete("temp.txt")
File1.stream(ok, "c","open read")
File2.stream("temp.txt","c","open write")
count = 0
loop while File1.lines() > 0
ok = File1.linein()
count = count + 1
if ok.substr(1, 3).upper() \= 'REM' then
File2.lineout(ok)
else
say 'Line' count 'not copied> ' ok
end