home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
FOXPRO
/
FCT1_12
/
STRIP.PRG
< prev
next >
Wrap
Text File
|
1990-07-06
|
2KB
|
64 lines
#include fct1.hdr
#include fileio.hdr
vardef
logical flag
logical again
char Buf
file stream_read
enddef
procedure force_main
params const char cmdlin
key_dos
scrn_dos
if .not. f_open(stream_read, token(cmdlin, " ", 2), &f_read)
?? "Can't open input file " + token(cmdlin, " ", 2)
_quit 1
endif
?? "*" + rtrim(center('Strip a header file, (c) 1990 by P.R.', 80))
? "*" + Rtrim(Center(token(cmdlin, " ", 2) + ' stripped version.', 80))
?
do while .not. f_eof(stream_read)
if .not. f_getln(stream_read, buf)
? 'error reading file ' + token(cmdlin, " ", 1)
_quit 2
endif
buf = alltrim(buf)
if substr(buf, 1, 1) <> "*" .and. substr(buf, 1, 1) <> '&&'
if again
flag = .t.
?? space(10) + buf
endif
if at('PROCEDURE', upper(buf)) <> 0 .or. at('FUNCTION', upper(buf)) <> 0
if flag
?
endif
flag = .t.
? buf
endif
if at('PARAMS', upper(buf)) <> 0 .or. at('PARAMETERS', upper(buf)) <> 0
flag = .f.
? ' ' + Buf
?
endif
if substr(buf,1,1)="#"
flag = .t.
? buf
endif
if at(";", buf) <> 0
again = .t.
else
again = .f.
endif
endif
enddo
f_close(stream_read)
endpro