Then the while look won't execute as %a will be 1 and %b will be $null.

What I ended up doing was preventing the /hadd if %b = $null

if (%b != $null) /hadd ...

Code:
alias iptracker.init {
  var %a = 1, %b = 1
  while (%a = %b) {
    var %c = $read(iptracker.txt,%a)
    var %nick = $gettok(%c,1,91)
    echo -s a: %a  nick: %nick  c: %c
    if (%c != $null) {
      /hadd -s iptracker %nick %b
      inc %a
    }
    var %b = $calc($readn + 1)
  }
}


I registered; you should too.