Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Funny: When a equal can to be not equal
Message
 
 
To
11/04/2005 13:16:45
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01003001
Message ID:
01003746
Views:
18
Fabio,

The code below is not repeatable. The next time you open the table in a new VFP session and insert rows the newly inserted rows would have replicated rand() values generated. This is due to the way that all pseudorandom number generators work.

>A simple example for you:
>
>* fill a table/cursor
>* Now you want a random uniform scan:
>INDEX RAND() TAG T_RAND
>SET ORDER TO T_RAND
>SCAN
>...
>ENDSCAN
>* repeatable! regardless from the UPDATE/REPLACE operations
>* none update overload!
>* none field used!
>REPLICATE ALL .....
>* next scan is the same of previous scan
>SET ORDER TO T_RAND
>SCAN
>...
>ENDSCAN
>* with a simple way for change the order!
>REINDEX
>
>
>With DATE()/DATETIME() is possible do more complex operations.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform