Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alphabetic numbering system
Message
From
08/01/1999 13:16:29
 
 
To
08/01/1999 12:07:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00174074
Message ID:
00174117
Views:
26
Hiya Erik ----

This will work all the way from "A" to "ZZZZZZZZZ"
LPARAMETERS cOldVal
LOCAL nBottomASC,nTopASC,nCharASC,nCarry
nBottomASC=65
nTopASC=90
nCarry=1
cNewVal=SPACE(0)
FOR i = LEN(cOldVal) TO 1 STEP -1
   nCharASC=ASC(SUBSTR(cOldVal,i,1))+nCarry
   nCarry=IIF(nCharASC>nTopASC,1,0)
   nCharASC=IIF(nCharASC>nTopASC,nBottomASC,nCharASC)
   cNewVal=CHR(nCharASC)+cNewVal
ENDFOR
IF nCarry > 0
   cNewVal="A"+cNewVal
ENDIF
RETURN cNewVal
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform