mIRC Homepage
Posted By: ScottK $hfind help - 13/02/05 04:35 PM
Code:
  
/hadd -m table nick prince charming is gay
//echo -a $hfind(table,prince,0).data return 0
//echo -a $hfind(table,*prince,0,w) return 1


why this is happen ? i need to find the item without the wildcard method , but it didnt works
can someone solve the problem ?
Posted By: DaveC Re: $hfind help - 13/02/05 06:33 PM
Quote:
Code:
  
/hadd -m table nick prince charming is gay
//echo -a $hfind(table,prince,0).data return 0
//echo -a $hfind(table,*prince,0,w) return 1


why this is happen ? i need to find the item without the wildcard method , but it didnt works
can someone solve the problem ?


Both those return zero

I suggest you do a /hfree -w table , i would assume you have a table item also called prince or somethingprince which is trigegring that.

I cant work out what you really want to do, so i can only say....

Based apon only the above existing in the table...
$hfind(table,*prince,0,w).data is zero since a item value ending in prince doesnt exist
$hfind(table,prince*,0,w).data is one since a item value begining in prince does exist
Posted By: remco25 Re: $hfind help - 14/02/05 03:57 AM

$hfind(table,prince,0).data <- searches the data for 'prince'
$hfind(table,*prince,0,w) <- searches the items for '*prince'

$hfind doesn't return the data with the .data property, it searches through it. Asuming you want to return the data for 'prince' in the first case you need to do:
$hget(table,$hfind(table,prince))

Hope this helps.

Remco
Posted By: Iori Re: $hfind help - 14/02/05 06:28 AM
You could use the 'r' switch but it makes the search case-sensitive unless you wrap it in /<match>/i, or precede it with (?i)<match>
  • //echo -a $hfind(table,prince,0,r).data
© mIRC Discussion Forums