mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Dec 2003
Posts: 12
try it yourself....

/hmake testing
/hadd testing testing this hash table bug
//echo -a $hmatch(testng,*)
it will echo "testing" -- when it really should say "testing this hash table bug"

the problem was able to be got around, but it was quite annoying, and caused a bit more code and headache than i had bargained for.

i dont know if this is an intended bug or what, but it may be worth mentioning that doing /hload file.txt will load spaces into hash values.

well, thaeres my bug, ltr


"The only foolish question is that which is not ask by a fool"
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
A hash table is designed to be a database. you have one word as the entry name, and the rest is its value. No bug, just proper working order. If you want spaces, use an ordered list like
/hadd 1 Bleh
/hadd 2 this is more blah
etc.

I mean even look at the help:

/hadd -smbczuN <name> <item> [data | &binvar]

The <item> is one space difference from [data] signifying that it's only to be treated as one word.


-KingTomato
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
<removed read what I wrote again and was just pointing out the same thing from another angle>

Last edited by DaveC; 28/01/04 07:59 AM.
Joined: Dec 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Dec 2003
Posts: 12
i figured it was my fault... but i couldn't figure out why /hload wasn't putting the data into that topic of the hash table.

oh well, thanks anyway -- i know how i will parse it, so no big deal


"The only foolish question is that which is not ask by a fool"
Joined: Apr 2003
Posts: 414
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 414
If you whant to use Hash data levels.. My script will help you wink

Code:
;Hash data levels 0.2
;hadd &lt;- Support quiet mode(.alias)
;$hgett &lt;- Support the propreties($identifier().prop)
;[color:#00007F]/hadd -s[color:red]lN[/color]mbczuN &lt;name&gt; &lt;item&gt; [data | &amp;binvar][/color]
;The [b]-l[/b] switch makes /hadd to look at N tokens after &lt;name&gt; like at one item.
;By Adrenalin
Alias Hadd {
  if (!$regex($1,/^-(.*)l(\d)(.*)$/)) {
    $iif(!$show,.) $+ hadd $1-
  }
  else {
    var %level = $regml(2)
    var %OSwitch = $remove($1,-l $+ %level)
    var %item = $gettok($1-,3- $+ $calc(%level + 2),32)
    var %item = $replace(%item,$chr(32),.)
    var %data = $gettok($1-,$calc(%level + 3) $+ - ,32)
    $iif(!$show,.) $+ hadd %OSwitch $2 %item %data
  }
}

Alias Hgett {
  if ($prop) var %prop = $+(.,$prop)
  if ($0 == 2) return $hget($1,$2) $+ %prop
  var %item = $replace($2-,$chr(32),.)
  return $hget($1,%item) $+ %prop
}

Alias Hash.data.levels.Test {
  echo -s Adding new hash table: Univers
  hmake Univers 1
  echo -s Adding a item to Univers
  hadd -ml3 Univers MilkyWay Earth Moldova Adrenalin
  echo -s The added item value is: $&amp;
    $hgett(Univers,MilkyWay,Earth,Moldova)
  echo -s Frees the hash table
  hfree Univers
}


The Alias Hash.data.levels.Test have some examples..

Quote:
/hload wasn't putting the data into that topic of the hash table.

A problem can be the integrity of the data file..


mIRC Chm Help 6.16.0.3 Full Anchored!

Link Copied to Clipboard