$rand() would be helpful because you can make sure you have two dissimilar numbers before pulling from the file. Yes, $read() can perform its own random selection, but why scratch the harddrive a dozen times before two unique lines are returned?
var %file = list.txt
var %lines = $lines(%file)
if (%lines < 2) { return }
var %r1 = $rand(1,%lines)
var %r2 = $rand(1,%lines)
while (%r2 == %r1) { var %r2 = $rand(1,%lines) }
var %line1 = $read(%file,n,%r1)
var %line2 = $read(%file,n,%r2)
Last edited by Raccoon; 23/04/15 06:04 PM. Reason: Corrected $rand(2,%lines) was incorrect. Thanks Ouims.