Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Anyone written code to replace SYS(2015)?
Message
 
To
26/09/2006 05:46:00
Peter Easson
Catalina Trading
Sydney, Australia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01157093
Message ID:
01157257
Views:
24
>sys(2015) is based on the following
>'Calling SYS(2015) more than once during the same millisecond interval will
>return a unique character string.' Whilst PHP doesn't have such a function,
>it's easy to simulate.

That's what I was thinking, Peter. Our main problem is that we're importing
VFP tables into a new MySQL database. There's a lot of data, with many
relationships based on SYS(2015)-generated primary keys. I guess we
could do away with the SYS(2015) keys and use an auto-increment field
for the primary key, but writing code to replace all those keys with
auto-increment values would probably be a pain :^). Well, it wouldn't
be that bad :^), but I figure it would be much simpler to just keep the
defined structure and emulate SYS(2015). Doing it this way allows us
flexibility and the capability of translating the VFP code directly,
without any "What the heck is that key?" BS and what not :^).

>Probably the easiest way to get a unique value in PHP is to md5() a
>microtime value. 'microtime() returns the current Unix timestamp with
>microseconds. This function is only available on operating systems that
>support the gettimeofday() system call.' md5 returns a string and microtime
>returns a value determined by the parameter set.See http://au3.php.net/microtime

Okay. From what I've seen so far, I think I'm going to translate the code
that Sergey and Dragan pointed my way into PHP, using your suggestions
on the UN*X/PHP side if necessary. Hopefully, I can come up with a
direct replacement. I'll be hacking that code right after I end this
message, so if anyone wants a copy, just let me know and I'll post
the PHP code in another message.

>VFP and PHP are the best of both worlds :-)

I couldn't agree more! :^). One good thing about both: if you know
structured basic and OOD, you basically know VFP (to some extent), and if
you know C/C++, then you know PHP. Can't get much better than that! :^)

Best regards, and thanks for the info, Peter.

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
Reply
Map
View

Click here to load this message in the networking platform