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

[REBOL] Re: Input validation routines

From: maximo:meteorstudios at: 27-Aug-2003 10:39

what I did in a prior version of liquid was an automatic datatype conversion system where you specify an output datatype and supply an input data. basically the function switches on entry datatype and then swithes again on the output datatype, depending on if it is at all possible to convert to-from. if any of the switches failed, I would return an empty data of the type requested in out format. It works really well, some of it is in the steel down load, within the steel-utils package. the method filter, as-decimal, as-integer, all try to convert to-from differrent datatypes. not many datatypes are covered, but those that are, really are usefull... for example, you can extract integer/decimal data out of any string even if it is full of formating text like labels. -max ----------- meteor Studios, T.D. ----------- Never Argue with an idiot. They will bring you down to their level and beat you with experience