mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 15
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2002
Posts: 15
ok, I finally found out whats causing the hash table to mess up, when I try to load a saved copy of a hash table I made in mirc (saved with hsave -bo tablename filename) I can view it in wordpad and it looks ok, I load it in mirc, and its screwed up, I save it again and the saved copy is messed up. as to whats causing the table to be corrupt, I'm not sure yet, the table contains various non alphanumeric characters so perhaps one of those is interfering, the code that I use is rather big so I'll try to get something smaller that can reproduce it, has anyone else seen a similar problem tho?

Joined: Dec 2002
Posts: 15
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2002
Posts: 15
ok, I found the problem, kinda, I dont know how or why mirc messes up with these values (I havent bothered to test it further but it screws up the whole hash table and removes these values in my script, and on their own, it just removes them leaving a blank hash table.

(alias command)
Code:
/testh {

  echo making new hash table: userid
  hmake userid 1000
  hadd userid who-1 100
  hadd userid who-2 5
  hadd userid who-3 1
  hsave -bo userid test.file
  echo saved 3 values, 1: $hget(userid,who-1) , 2: $hget(userid,who-2) , 3: $hget(userid,who-3)
  hfree userid
  hmake userid 1000
  echo loading new values
  hload userid test.file
  echo loaded 3 values, 1: $hget(userid,who-1) , 2: $hget(userid,who-2) , 3: $hget(userid,who-3)
  hsave -bo userid test2.file
  echo files created, test.file and test2.file
}
  


with this code, I get:

making new hash table: userid
saved 3 values, 1: 100 , 2: 5 , 3: 1
loading new values
loaded 3 values, 1: , 2: , 3:
files created, test.file and test2.file

Joined: Dec 2002
Posts: 44
P
Ameglian cow
Offline
Ameglian cow
P
Joined: Dec 2002
Posts: 44
Wouldn't saving as a binary file, imply that you also have to load it as a binary file.

You are forgetting the -b option to hload.


Suck it, lick it, milk it then put it away.

Link Copied to Clipboard