Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A,B,C sequence needs help
Message
From
02/12/1998 20:17:39
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00163167
Message ID:
00163495
Views:
38
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform