Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Alphabetic numbering system
Message
De
09/01/1999 16:24:57
 
 
À
08/01/1999 12:07:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00174074
Message ID:
00174384
Vues:
21
Eric,

This is a portion of some code that I use for a base36 numbering system. You might take a look at this as well. Basicly I "convert" a base10 number to a base36 number where idnum is the base 10 number.


* "Digits" of our base-36
st="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"

DO WHILE m.idnum>0
m.ret=SUBSTR(m.st,(m.idnum%36)+1,1)+m.ret
m.idnum=INT(m.idnum/36)
ENDDO
* "Digits" of our base-36
st="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"

John

>I am faced with the need to create (actually participate with) an alphabetic numbering system. The sequence is straight forward, and looks like this:
>
>AAAA
>AAAB
>.
>.
>AAAZ
>AABA
>
>etc.
>
>Really my only need is to be able to increment these codes by one, so I need a function that receives "DPRZ" and returns "DPSA". Get it?
>
>I am fairly confident that I can pound out the code to do this, but all of my ideas so far would take an enormous amount of code- can anybody think of a practical solution?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform