Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoiding Dublicate Field entries in a multi-user applica
Message
From
23/02/1998 18:41:57
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
20/02/1998 13:12:54
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00080125
Message ID:
00080618
Views:
25
>snip...

>Most programmers end up using something on this order. I have a different situaton where I have independent installations that may want to merge their data. I use SYS(3) to generate keys. One draw back is the number is nonsense and sometimes you would like to know the order records were added for audit purposes. Do you know of other draw backs to using sys(3)?

The return value of Sys(3) was prone to changes thru different versions of Fox and OSes used. In mFoxPlus, under Dos 3.x, up to FoxPro 1.0x, it returned eight characters, unless used on a Novell 2.x network, where it returned a dollar sign and seven digits; on Foxplus/Xenix it also returned something slightly different. Then, on FoxPro 1.0x it returned these digits transformed into letters, and there seemed to be sixteen of them (A to P, A probably representing a hex zero), and it suddenly reverted to decimal digits.

The other problem may be resolution of the clock it uses - I'm not sure it will generate unique keys. I tried this:

dime x(10)
for i=1 to 10
x(i)=sys(3)
endf
for i=1 to 10
?x(i)
endf

It succeeded in repeating a value, and I have had both UT Nav and VFP open at the same time, on a 133MHz K5. You can imagine what it may do on quicker machines. Sys(3) is suitable for a random filename - filenames are not created in consecutive milliseconds. For keys, no.

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