mIRC Homepage
Posted By: Mail Placing hash table info into dialog list box - 11/02/06 04:41 AM
I am trying to get the information from a hash table and place it into a dialog list box.
One: Is this even possible?
Two: If possible, Suggestions would be appreciated.

I would like to be able to achieve this without using variables. I am starting to think its not possible without using them though.
example:
Code:
on *:dialog:as:init:*:{
  var %as6awyn = 1
  while ($hget(away,%as6awyn).item != $null) {
    did -a as 22 $hget(away,%as6awyn).data
    inc %as6awyn
  }
  }
1) It is possible
2) your code would look something like
Code:
 did -a <dialog> <id> $hget(<table>,<item>)
 


This is a very basic example of how you could do it.

If you want more details, supply the code for the dialog set-up and how the items are stored in the hash table
Thanks Neutron, That worked fine. I thought it was possible. Thanks also Russel for your response as well.
You could use something like this, assuming the hash table name is "somehash", your dialog name is "somedialog" and the listbox ID is 5:
Code:
  hsave -n somehash somehash.temp
  filter -fo somehash.temp somedialog 5
  .remove somehash.temp


I posted this not because it doesn't use variables (which is a very weird requirement, why wouldn't you want to use variables?), but because it's faster for large tables. However this method is limited; you can only dump the items' data in the listbox, you can't include the item names or do something with the data before you output it (unless you use /filter's -k switch in the second case).
© mIRC Discussion Forums