[REBOL] Re: there's a wey better way...
From: compkarori:gma:il at: 11-Nov-2007 23:14
If you using switch, you can factor out the set-word like this
quarter: switch month [ n [ nn ]]
but this is simpler
quarter: 1 + to-integer month / 4
On Nov 12, 2007 10:23 AM, Kai Peters <kpeters-otaksoft.com> wrote:
>
> Right now I am using
>
> switch month [
> 1 [ quarter: 1 ]
> 2 [ quarter : 1 ]
> 3 [ quarter : 1 ]
> 4 [ quarter : 2 ]
> 5 [ quarter : 2 ]
> 6 [ quarter : 2 ]
> 7 [ quarter : 3 ]
> 8 [ quarter : 3 ]
> 9 [ quarter : 3 ]
> 10 [ quarter : 4 ]
> 11 [ quarter : 4 ]
> 12 [ quarter : 4 ]
> ]
>
> Any suggestions?
>
> TIA
> Kai
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
--
Graham Chiu
http://www.synapsedirect.com
Synapse-EMR - innovative electronic medical records system