Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert a cursor from temporary to permanent
Message
From
15/02/2002 00:40:25
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
14/02/2002 15:47:18
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00619899
Message ID:
00620505
Views:
27
>>BTW
>>Hate this sys(2015). Everytime it crashes, I just see cryptic names. Have automated complex rekursive integrety checks controled by metadata over my tables where I crossed the same SELECT ... INTO n times. I prefer speaking names like Test_099 for test in 99th rekursion ...
>
>And how does that work for a network? The reason I use sys(2015) is to avoid two users creating the same filename on the network. Of course, if you are sure you can access getenv("temp"), you can create files on your local drive.

It is cruel I know. I don't need or want to do this on a network - it is only for local processes. So it shoud be on local computer to avoid network traffic.
I started this before I found SYS(2015) and now I'm used to. ::)

I figure out TempPath THEN I do something like

lcPath = ADDBS(GETENV("TEMP"))
lcTable = 'Test'
lcTable_ = lcTable
lnLoop1 = 1
DO WHILE USED(lcTable_) OR FILE(lcPath+lcTable_+'.dbf')
lcTable_ = lcTable+'_'+TRANSFORM(lnLoop1)
lnLoop1 = lnLoop1+1
ENDDO &&USED(lcTable_)

lcTable = lcTable_
lcTable_ = lcPath+lcTable_
CREATE TABLE lcTable_ (...)
INSERT INTO (lcTable) (...


If you avoid the OR FILE(lcPath+lcTable_+'.dbf') clause you can generate speaking cursor names as well.

This is useful in debugging iterations or rekursions.
I have an UDF with Filename as parameter and return is the free name.

>
>You could also use "DescriptiveTableName_" + sys(2015).
The solution above give me iteration deepness


Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform