Link to home
Start Free TrialLog in
Avatar of Softtech
Softtech

asked on

123456789 to 482176935

I am looking for suggestions on how to handle the following task using Delphi 3...

Assuming I have a text file which contains 1000 lines of text (the 1000 could vary, BTW)...  I would like to generate a new file containing the same 1000 lines of text, HOWEVER, I want the lines to be RANDOMIZED, so that...

1
2
3
4
5
6
7
8
9

...will be saved to disk as...

4
8
2
1
7
6
9
3
5

...or some other randomized order.

Any suggestions on the best method to do this?
Avatar of sburck
sburck

If you keep your lines in a TStringList, and made a randomizer your customsort function, each call to it would randomize the order of the list.  Look at the docs on customsort.
ASKER CERTIFIED SOLUTION
Avatar of retep
retep

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of simonet
Following...®
Avatar of Softtech

ASKER

retep...it works fine for my purposes.  Thanks!