Versions des environnements
More like this:
*
** AlphaID Incrementer
*
FUNCTION AlphaIDIncrementer
LPARAMETERS cAlphaID
LOCAL nIndex,nIDLEngth,cCharToIncrement
nIDLength = LEN(cAlphaID)
FOR nIndex = 1 TO nIDLength
cCharToIncrement=SUBSTR(cAlphaID,nIDLength-nIndex+1,1)
cCharToIncrement=CHR(ASC(cCharToIncrement)+1)
IF cCharToIncrement > "z"
cCharToIncrement = "a"
STUFF(cAlphaID,nIDLength-nIndex+1,1,cCharToIncrement)
ELSE
STUFF(cAlphaID,nIDLength-nIndex+1,1,cCharToIncrement)
EXIT
ENDIF
ENDFOR
IF nIndex > nIDLength
RETURN .F. && Overflow
ENDIF
RETURN cAlphaID
Note: alphaID must not be mixed case, it must be either upper or lower case. Also must be characters a-z.
>So, is that something like the following?
>
>lcID="aaaaa"
>lnID=ASC(lcID) + 1
>
>>You just increment it by 1 , each time. When it becomes greater than a "z" you set it back to an "a" and increment the character to the left.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement