Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Anyone written code to replace SYS(2015)?
Message
From
26/09/2006 17:39:48
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01157093
Message ID:
01157360
Views:
28
>Hey, Hilmar. Nice to hear from you again, dude.
>
>>Some programmers use GUID - that might be an option. It is somewhat longer, though (16 bytes).
>
>GUID? Not familiar with that -- yet! :^). Will give it a look and see
>what gives. Currently, we're hacking some Intranet PHP web apps, but
>it looks like we'll be shifting back to full-time VFP soon. One of our
>sales reps went and did something wonderful and sold two VFP apps we
>wrote, so it looks like Sameer and I will be lurking here more often,
>asking dumb newb questions and all :^).
>
>Randall

Brief summary - and please note that I am no expert on this: GUID is a Windows function (API) that gives you a 16-byte value, unique in the World (if the computer has a network card), and very likely unique (if it doesn't). The uniqueness is guaranteed because the unique value is calculated on the basis of the MAC address (the network card serial number), which is supposed to be unique. (I heard of cases where they weren't, because of factory defects.)

For this reason - the fact that uniqueness is almost guaranteed - some programmers use GUIDs as a convenient primary key.

However, they are quite long; you might also consider the following alternatives, whether it be for a serial number or for generating unique filenames:

1) If there is a permanent connection to a shared database, store some incremental number there.

2) If there isn't, use a serial number in a local database, and combine it with a unique code assigned to each user.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform