Something like this maybe ?

Code:

break on

srnd(@ticks)

$file = @scriptdir + '\test.txt'
$_ = open(1,$file)

;read contents of file to a delimited string value
$txt = readline(1)
while not @error
$txt = $txt + "~" + readline(1)
loop
$_ = close(1)

$txt = left($txt,-1) ;remove last delimiter
$txt = split($txt,'~') ;split that string to an array

$rand = rnd(ubound($txt))
"Random line #1: " + $txt[$rand] ?
"Random line #2: " + $txt[$rand+1] ?

get $
exit 0



Note: didn't bother to implement good coding practices in that sample like NoVarsInStrings and Explicit set ot on

[edit: consecutive means then that the second line needs to be the line after the first then? K, edited code to match that]


Edited by Jochen (2005-06-16 10:29 AM)
_________________________