Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
1st, 2nd, 3rd, 4th, 5th ... nth
Message
From
30/11/2000 00:09:26
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00446283
Message ID:
00447211
Views:
22
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform