Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[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>&nbsp;</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>&nbsp;</DIV> <DIV><FONT color=#000000 size=2>btw: these are html files with one body having BGCOLOR=&quot;white&quot; and one simply having <BODY></FONT></DIV> <DIV><FONT color=#000000 size=2></FONT>&nbsp;</DIV> <DIV>----- start of function -----</DIV> <DIV>&nbsp;</DIV> <DIV><FONT color=#000000 size=2> <DIV>make_generic_html_locator: func [<BR>&nbsp; a [file!] &quot;Filename to add location reference for&quot;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]<BR>&nbsp;[<BR>&nbsp;page_content: &quot;sd&quot;<BR>&nbsp;clear page_content<BR>&nbsp;if not exists? a [print reform [&quot;File not found:&quot; a] halt]<BR>&nbsp;in_file: read a<BR>&nbsp;in_file: make string! in_file<BR>&nbsp;if not find in_file &quot;<HTML>&quot; [print &quot;File is not HTML Compliant&quot;<BR>&nbsp;&nbsp;&nbsp;&nbsp; halt]</DIV> <DIV>&nbsp;</DIV> <DIV>&nbsp;if find in_file &quot;<TITLE>&quot; [<BR>&nbsp;parse in_file [thru {<TITLE>} copy page_title to {</TITLE>}]<BR>&nbsp; print page_title<BR>&nbsp;&nbsp;&nbsp;&nbsp; ]<BR>&nbsp;parse in_file [thru {<BODY} copy body_attrib to {>}]<BR>&nbsp;body_tobe: rejoin [{<BODY} body_attrib {>}]<BR>&nbsp;if find in_file &quot;<BODY>&quot;&nbsp; [body_tobe: {<BODY>}]<BR>&nbsp;parse in_file [thru body_tobe copy page_content to {</HTML>}]<BR>&nbsp; print body_tobe<BR>&nbsp; print page_content<BR>&nbsp; clear page_content<BR>&nbsp; clear body_tobe<BR>&nbsp; print &quot;Generic Page Locator Finished&quot;<BR>&nbsp;]<BR></DIV></FONT></DIV></FONT></DIV></BODY></HTML> ------=_NextPart_000_0060_01BF6DE1.2EC38D20--