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

[REBOL] Re: [Nifty Function of the Day] Pad

From: greggirwin:mindspring at: 16-Aug-2003 9:37

Hi Ashley, AT> How about one that justifies based on type? AT> pad: func [value width] [ AT> either any [number? value money? value date? value] [ AT> head insert/dup value: form value " " width - length? value AT> ][ AT> head insert/dup tail value: form value " " width - length? value AT> ] AT> ] You can remove the redundancy in that code like this: pad: func [value width /local op] [ op: either any [number? value money? value date? value] [:head][:tail] head insert/dup op value: form value " " width - length? value ] -- Gregg