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

[REBOL] Re: (long) RE: Re: help me parse this?

From: al:bri:xtra at: 6-Nov-2000 16:58

Wayne Pierce wrote:
> REBOL[] > > (1) page: { > <HTML> > <HEAD> > <TITLE></TITLE> > </HEAD> > <BODY> > <SELECT>} > > (2) options: read %options.txt > > (3) options: parse options none > > (4) body: [] > > (5) disarm try[ while [length? options][ > (6) append body join "<OPTION>'" join first options join "'</OPTION>" > join second options #"^/" > (7) remove head options > (7) remove head options > ]] > > (8) append page body > (9) append page {</SELECT></BODY></HTML>}
Better might be: [ Rebol [] Page: make block! 0 insert head Page [ <html> <head> <title> "Insert your Page title here" </title> <body> <select> ] foreach [Value Text] parse read %Options.txt none [ append Page reduce [ <option> Value </option> Text newline ] ] append Page [ </select> </body> </html> ] write %YourFileNameHere.html join "" Page ] Or using my HTML dialect: [ Rebol [] do %HTML.r write %YourFileNameHere.html HTML [ title "Insert your Page title here" body h1 "Insert your Page title here" select load %Options.txt ] ] I hope that helps! Andrew Martin ICQ: 26227169 http://members.nbci.com/AndrewMartin/