Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is shorter than Sys(2007) ?
Message
 
 
À
27/05/2008 11:53:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01319700
Message ID:
01319737
Vues:
15
CLEAR
lnVal = INT(VAL(SYS(2007, "whatever")))

lcLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lcCharList = lcLetters + LOWER(lcLetters)
lnBase = LEN(lcCharList)
lcVal = ""
DO WHILE lnVal > 0
	lnRest = lnVal % lnBase
	lnVal = INT( lnVal / lnBase)
	lcVal =  SUBSTR(lcCharList, lnRest,1) + lcVal
ENDDO
? lcVal
>
>The length of sys(2007) is 5 numbers. I'd like to convert this into a character string of alphabetic letters (A-Z), in order to get rid of some positions. I can write the algorithm, but perhaps someone else already wrote one?!
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform