[REBOL] why this not work?
From: etcha::gsat::net::au at: 3-Feb-2000 0:54
This is a multi-part message in MIME format.
------=_NextPart_000_0060_01BF6DE1.2EC38D20
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
i just cant keep figuring out when you use this with two different files and go say:
function <file here>
function <second file here>
function <file here>
btw: these are html files with one body having BGCOLOR="white" and one simply having
<BODY>
----- start of function -----
make_generic_html_locator: func [
a [file!] "Filename to add location reference for"
]
[
page_content: "sd"
clear page_content
if not exists? a [print reform ["File not found:" a] halt]
in_file: read a
in_file: make string! in_file
if not find in_file "<HTML>" [print "File is not HTML Compliant"
halt]
if find in_file "<TITLE>" [
parse in_file [thru {<TITLE>} copy page_title to {</TITLE>}]
print page_title
]
parse in_file [thru {<BODY} copy body_attrib to {>}]
body_tobe: rejoin [{<BODY} body_attrib {>}]
if find in_file "<BODY>" [body_tobe: {<BODY>}]
parse in_file [thru body_tobe copy page_content to {</HTML>}]
print body_tobe
print page_content
clear page_content
clear body_tobe
print "Generic Page Locator Finished"
]
------=_NextPart_000_0060_01BF6DE1.2EC38D20
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META content='"MSHTML 4.72.3612.1706"' name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#000000 size=2>i just cant keep figuring out when you use this
with two different files and go say:</FONT></DIV>
<DIV><FONT color=#000000 size=2></FONT> </DIV>
<DIV><FONT color=#000000 size=2>function <file here></FONT></DIV>
<DIV><FONT color=#000000 size=2>function <second file here></FONT></DIV>
<DIV><FONT color=#000000 size=2>
<DIV><FONT color=#000000 size=2>function <file here></FONT></DIV>
<DIV><FONT color=#000000 size=2></FONT> </DIV>
<DIV><FONT color=#000000 size=2>btw: these are html files with one body having
BGCOLOR="white" and one simply having <BODY></FONT></DIV>
<DIV><FONT color=#000000 size=2></FONT> </DIV>
<DIV>----- start of function -----</DIV>
<DIV> </DIV>
<DIV><FONT color=#000000 size=2>
<DIV>make_generic_html_locator: func [<BR> a [file!] "Filename to add
location reference for"<BR>
]<BR> [<BR> page_content: "sd"<BR> clear
page_content<BR> if not exists? a [print reform ["File not
found:" a] halt]<BR> in_file: read a<BR> in_file: make string!
in_file<BR> if not find in_file "<HTML>" [print "File
is not HTML Compliant"<BR> halt]</DIV>
<DIV> </DIV>
<DIV> if find in_file "<TITLE>" [<BR> parse in_file
[thru {<TITLE>} copy page_title to {</TITLE>}]<BR> print
page_title<BR> ]<BR> parse in_file [thru {<BODY}
copy body_attrib to {>}]<BR> body_tobe: rejoin [{<BODY} body_attrib
{>}]<BR> if find in_file "<BODY>" [body_tobe:
{<BODY>}]<BR> parse in_file [thru body_tobe copy page_content to
{</HTML>}]<BR> print body_tobe<BR> print
page_content<BR> clear page_content<BR> clear body_tobe<BR>
print "Generic Page Locator
Finished"<BR> ]<BR></DIV></FONT></DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_0060_01BF6DE1.2EC38D20--