>Hmmm... given the constraint iNumber can only be 1-31, you could also make it more straightforward:
>
>FUNCTION fOrdinal( iNumber )
>return subs("stndrdthththththththththththththththththstndrdthththththththst", (iNumber*2)-1, 2)
Why stop at 31 when, combining ideas gives the more general Webber-Houstonian transformation?
function fOrdinal( i )
return str(i)+iif(mod(i,100)<14,;
subs("thstndrdthththththththththth",mod(i,100)*2+1,2),;
subs("thstndrdththththththth",mod(i,10)*2+1,2))
endfunc
This will leave those information theory types who like to talk about 0th order loops happy as clams!
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum