Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A,B,C sequence needs help
Message
De
02/12/1998 20:17:39
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00163167
Message ID:
00163495
Vues:
32
>vfp 3.0 win 98
>
>Hello All,
>
>Trying to automatically generate new invoice number
>with a separate field that shows a,b,c etc.
>
>Came across the ASC() COMMAND and example
>but can't get it to work properly in this situation.
>
>Any thoughts? Thanks and have a great day!
>
>Becky
Maybe something like this will help...
Assuming that you can locate the last letter used, store it to cLastLtr, then


cNextLtr=iif(empty(cLastLtr),"A",CHR(ASC(cLastLtr)+1))

should return...
"A" if cLastLtr is " "
"B" if cLastLtr is "A",ect...

You will probably need to include a validation routine to hande cases where cLastLtr="Z" or any other non alpha character.

HTH
//:^)
L.A.Long
ProgRes
lalong1@charter.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform