home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Meeting Pearls 3
/
Meeting_Pearls_III.iso
/
Pearls
/
text
/
FAQ
/
bonus
/
faq_createhtml_byKL.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-10-10
|
2KB
|
77 lines
/* ARexx skript, erzeugt HTML aus FAQ-Liste
$VER: faq_createhtml.rexx 0.1 (05.08.95) ©1995 Khamsonh Marcel Khounlivong
- FAQ.html ist Haupt-Dokument
*/
PARSE ARG listfile textdir
listfile = Strip(listfile)
newsgroup = SubStr(listfile,1,LastPos('.files',listfile))'answers'
IF (Pos('/',newsgroup) ~= 0) THEN
newsgroup = SubStr(newsgroup,LastPos('/',newsgroup)+1)
enter = '0a'x
if (~Open(infile,listfile,r)) THEN DO
SAY "Can't open"listfile
EXIT 20
END
SAY '<html>'enter
SAY '<! 'newsgroup' document (automagic proceeded)'
SAY ' $VER: newsgroups-'newsgroup'.html ('date()')'enter
SAY ' (c) Meeting Pearls Group'
SAY ' Script-author: Khamsonh Marcel ''ninji'' Khounlivong>'enter
SAY '<head><title>'newsgroup'</title></head>'enter
SAY '<body background="../.pix/FAQbg.gif'
SAY ' bgcolor="#aaaaaa'
SAY ' text="#000000'
SAY ' link="#778899'
SAY ' vlink="#334455'
SAY ' alink="#667788>'
archive = Word(ReadLn(infile),1)
CALL gettopic
DO WHILE (~Eof(infile))
topic.1 = topic.2
SAY '<h4>'topic.1'</h4>'enter
DO WHILE (topic.2 == topic.1 & ~Eof(infile))
dir.2 = SubStr(archive,1,LastPos('/',archive))
dir.1 = dir.2
SAY '<dl><dd><b>'dir.2'</b><br>'
eintrag = ''
DO i = 0 WHILE (dir.2 == dir.1 & ~Eof(infile))
eintrag = eintrag' <a href="FAQ/'archive'">'SubStr(archive,LastPos('/',archive)+1)'</a>'enter
archive = Word(ReadLn(infile),1)
IF (~Eof(infile)) THEN dir.2 = SubStr(archive,1,LastPos('/',archive))
END
SAY eintrag' </dl>'enter
CALL gettopic
END
END
CALL Close(infile)
SAY '</body>'enter
SAY '</html>'
EXIT
gettopic:
DO UNTIL (position ~= 0 | Eof(infile))
position = Pos('/',archive)
DO WHILE (position == 0 & ~Eof(infile))
SAY '<h4><a href="FAQ/'archive'">'archive'</a></h4>'enter
archive = Word(ReadLn(infile),1)
IF ~Eof(infile) THEN position = Pos('/',archive)
END
IF ~Eof(infile) THEN topic.2 = SubStr(archive,1,position-1)
END
RETURN