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

[REBOL] Re: Conditional Parsing

From: apwing::zonnet::nl at: 6-May-2005 16:32

Hi Giuseppe, does the following script help you a bit? Kind regards, Arie =================================== script follows ============================================= rebol [] example1: { Name: John Surname: Doe Book: Private America 1stPubblication: 1950 Brief description: oo xx oo xx oo xx } example2: { Name: Jane Surname: Doe Height: 1.75m Eyes: Brown Hair: Blonde Hobbies: Play Tennis, Swim, Music Book: Private Women of America 1stPubblication: 1950 Brief description: oo xx oo xx oo xx Woman } rule: [ thru "Name: " copy name to "^/" (print ["Name: " name]) thru "^/" thru "Surname: " copy surname to "^/" (print ["Surname: " surname]) thru "^/" 0 1 [ thru "Height: " copy height to "^/" (print ["Height: " height]) thru "^/"] 0 1 [ thru "Eyes: " copy Eyes to "^/" (print ["Eyes: " Eyes]) thru "^/"] 0 1 [ thru "Hair: " copy Hair to "^/" (print ["Hair: " hair]) thru "^/"] 0 1 [ thru "Hobbies: " copy Hobbies to "^/" (print ["Hobbies: " Hobbies]) thru "^/"] thru "Book: " copy book to "^/" (print ["Book: " book]) thru "^/" thru "1stPubblication: " copy first_publ to "^/" (print ["1stPubblication: " first_publ]) thru "^/" thru "Brief description: " copy brief_descr to "^/" (print ["Brief description: " brief_descr]) thru "^/" ] print "" print "Parsing example1" print "================" print parse/all example1 rule print "" print "Parsing example2" print "================" print parse/all example2 rule halt =========================================== end of script ============================================ Giuseppe Chillemi wrote: