Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unique Procedure Name but in alphabets only
Message
From
13/11/2007 13:23:49
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
Firebird
Miscellaneous
Thread ID:
01268586
Message ID:
01268687
Views:
14
This message has been marked as the solution to the initial question of the thread.
>Hi all
>
>I need to have a unique procedure name but in alphabets only. The reason being that I need to create a (temp) table on the FireBird backend.

If length of the name is not a problem, why not use a GUID? Or use a timestamp consisting of Julian date number, then number of milliseconds since midnight, each encoded in base26 or base52 (i.e. A-Z only, or A-Z+a-z):
trnN2S = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

	Procedure n2s(tNR, nLen)
	Local nMod, numdat, sl
	nMod=Len(This.trnN2S)
	numdat=tNR
	sl=""
	Do While numdat>0
		ns=numdat%nMod
		sl=Substr(This.trnN2S,ns+1,1)+sl
		numdat=Int(numdat/nMod)
	Enddo
	If !Empty(nLen) And Len(sl)<nLen
		sl=Padl(sl, nLen, Left(This.trnN2S,1))
	Endif
	Retu sl
In base26 you'd need 5+6 characters for this; in base 52 (i.e. in case Firebird is case sensitive) it's 4+5.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform