Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Serial Number with A-Z
Message
From
19/07/2000 04:01:30
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00394168
Message ID:
00394216
Views:
15
>I need a serial # scheme that works like newid(), But uses Letters as well as numbers. Anyone have some code or know where I can get it.
>Oh i'm using vfp 5
>
> Thanks Kelly


This is only with A-Z :
function myAlpha && Haven't tried but supposed to work up to 26^128
lparameters tnValue && Convert tnvalue to Excel alpha notation
if tnValue = 0
	return ""
endif
if tnValue <= 26
 return chr(asc("A")-1+tnValue)
else
 return ;
   myAlpha(int(iif(tnValue% 26 = 0,tnValue - 1, tnValue) / 26)) + ;
   myAlpha((tnValue-1)%26+1)
endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform