Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A little confused with RAND()
Message
 
 
To
01/04/2009 10:11:01
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01392453
Message ID:
01392591
Views:
47
>>
>>I use this "RAND(()" approach to generate the same key/code on my computer and the customer computer. The customer does not know that I use this routine and thinks that it is completely random. Once I tell them to enter the returned "code/key" the program verifies it (using the same code I use on my PC) and can perform a procedure that should only be performed under "my supervision." I hope my explanation is clear.
>
>A year ago I would have told you this could be broken by the next version of Fox... if it decides to change the randomizer's algorithm. You should be safe from that kind of surprise now... unless, in the background, rand() is just a wrapper around some API call, which may change at random (don't hang the pun, pardon it) with any version or SP of Windowses. Which we don't know... so I'd rather have a sys(2007) of something based on the dates - it would still look random, but wouldn't be.

Even if there was another version of VFP in the works, I wouldn't worry about my "random" code. I know it is or maybe not perfect. I have too many things on my plate and therefore I consciously have to make decisions of path of least resistance (or minimum time). My primary goal right now is to get my VFP application to use SQL Server database and then find someone to rewrite it in .NET/Java or whatever.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform