Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
1st, 2nd, 3rd, 4th, 5th ... nth
Message
De
30/11/2000 00:09:26
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00446283
Message ID:
00447211
Vues:
12
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform