Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is shorter than Sys(2007) ?
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01319700
Message ID:
01319737
Views:
14
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform