mIRC Home    About    Download    Register    News    Help

Print Thread
#10256 08/02/03 03:36 PM
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
Code:
 alias find_HT {
  window -ek0 @hashtables
  var %totalht $hget(0)
  while %totalht > 0 {
    var %httotal $hget(%totalht,0)
    while %httotal > 0 {
      aline 4 @hashtables $hget(%totalht,%httotal).data
      dec %httotal
    }
    dec %totalht
  }
  echo @hashtables Finished, hopefully
}
 
I wrote the above code to hopefully get a list of all the hash tables and the data contained in them, but its not working. I am still learning hash tables, and i seem to have made a mistake, it only prints out "Finished, hopefully". It doesn't print out any of the hash tables or the data in them, can yall help me?


keek: Scots - intr.v. keeked, keekĀ·ing, keeks
To peek; peep.
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Code:

alias find_HT {
  window -ek @HashTables
  var %tables = 1
  while $hget(%tables) != $null {
    var %table = $ifmatch
    var %item = 1
    while $hget(%table,%item).item != $null {
      aline 4 @HashTables $hget(%table) :: $ifmatch :: $hget(%table, $ifmatch)
      inc %item
    }
    inc %tables
  }
  aline @HashTables $chr(2)
  echo @HashTables Finished, definitely!
}


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
thanks hammer.


"finished, definatly" lol i like that


keek: Scots - intr.v. keeked, keekĀ·ing, keeks
To peek; peep.

Link Copied to Clipboard