In my above code add a simple else that should do the trick.

Code:
on 1:sockread:qrz:{  
  if ($sockerr) {    
    echo -a Error.    
    halt  
  }  
  else {    
    sockread %temptext 
    if (Country isin %temptext) {
      echo -a $read(hams.txt,%ln) is $html(%temptext)
      %ln = %ln + 1
      if (%ln <= $lines(hams.txt)) { 
        set %url $read(hams.txt,%ln)
        qrz
      }
     else { unset %ln }
    }
  }
}


It unsets the line number when it's finished.

PY2BN Country:BRAZIL
TI2JJP Country:COSTA RICA
LU6FOV Country:ARGENTINA
KI4MJO Country:USA
YV4DYJ Country:VENEZUELA
NP4A Country:USA
ZP6DYA Country:BRAZIL
YO9HP Country:ROMANIA
KB0RGS Country:USA
YU1XA Country:SERBIA
CT3MD Country:PORTUGAL
W1AW Country:USA
KI4MJO Country:USA
GB6MD Country:England - U.K.
WW2SUB Country:USA
NI4BK Country:USA
HB9Z Country:SWITZERLAND
F5BBD Country:FRANCE

If it still doesn't work for you, there are others here available to help. It's my bed time now. grin