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

[REBOL] Re: To do or not to do?

From: rotenca:telvia:it at: 28-Nov-2001 23:40

Hi, the first thing i've done is (but there are others methods): ;; rules table ;; =========== Rules: [ [(length? to-string x) > 0] "No data" [date? x] "Bad date" [(x - 14 ) < now/date] "Too old" [specialcheck x] "Not special" ] ;; prepare data field ;; ============== RawValue: "5-122-2001" ;; bad date in this example Loadedvalue: "" if error? try [loadedValue: first load/all Rawvalue] [LoadedValue: RawValue] ;; apply rules ;; =========== foreach [rule message] Rules [ if not do func [x] rule LoadedValue [ print [LoadedValue " fails rule: " Message] break ] ; if ] ; for --- Ciao Romano