Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Anyone written code to replace SYS(2015)?
Message
 
To
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:
01157545
Views:
25
Hi again, Hilmar, and thanks for the reply.

>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).

Hmmm. Sounds like IPv6 or something.

>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.

Sure sounds like something good to use. Just looked it up. "Globally Unique IDentifiers."
Kewlness.

>However, they are quite long;

Would this be a good thing or a bad thing? (Shrug.) The larger the value, the better
the possibility of being unique. OTOH, I'd imagine that doing something like:
"No, Dave. The ID of that record is '_$L1B8ACF3LLJ133Z'" would be kinda obfuscated
and cryptic when discussing this stuff over the phone :^).

>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.

Not guaranteed, in our situation, unfortunately :^/ . Sometimes the client will have net
access; sometimes it won't. Wells are drilled just about everywhere, and most remote
locations (Gulf of Mexico, etc.) don't have access to the net. The major oil companies,
OTOH, usually lease satelite links (expensive), so "sometimes" they have a connection.


Anywho, all of our VFP apps are using the SYS(2015) call, and our newer PHP-MySQL web
apps are built specifically to display the client's VFP tables. In most situations,
we have to import their DBF tables. There's literally terabytes of records and info, with
a lot of the data being backed up and saved for safe keeping. Should one of our
customers ask if we can put some of their older data on the web, we'll be ok with
it, because we've cloned the SYS(2015) call in PHP. Everything still works just fine
that way, if you know what I mean.


BTW, Sameer and I have been throwing around the idea of cloning a lot of the VFP
functions in PHP, naming them exactly like they are in VFP. Reason: in case we
need to port some code over, we just cut and paste, edit it a bit, and now we
have a new page that functions almost exactly like the VFP app. In other words,

ALLTRIM(txtPasswd) would be cloned like this:
FUNCTION ALLTRIM($txtPasswd)
{

 return trim($txtPasswd); // the real PHP func.

}
If we clone enough of the VFP calls, it should make life a lot easier around
here :^).

>2) If there isn't, use a serial number in a local database, and combine it
> with a unique code assigned to each user.

Good idea, but, unfortunately, we have to make things backward compatible.
I totally wish we could do something like this, Hilmar.

Thanks for the info, dude.

Randall
--
Randall Jouett
Amateur/Ham Radio: AB5NI
I eat spaghetti code out of a bit bucket while sitting at a hash table! Someone
asked me if I needed salt, and I said, "I'm not into encryption." :^)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform