Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading plaintext?
Message
 
To
21/11/2008 17:57:16
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01363610
Message ID:
01363626
Views:
11
This message has been marked as a message which has helped to the initial question of the thread.
>I was asked for help with a toy project - read in a plaintext file and return a random line from the file. I could do this easily with a table, but don't know enough about low level file functions to do that job easily. Can I get a kick in the right direction, please?
>
>Chris.

Just a quick thought (ie not completly thought through)

How about this:

RAND()
lcText = FILETOSTR("myFile.txt")
ALINES(myText, lcText)
?myText[RAND()*ALEN(myText)]
Bud Wheeler
Vision Data Solutions, Inc.
Microsoft Partner

http://www.visionpace.com
Http://www.BudWheeler.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform