From WikiChip
Difference between revisions of "mirc/commands/hfree"
< mirc‎ | commands

m (Bot: Adding a template)
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The '''/hfree command''' destroys a previously created hash table(s). The /hfree command destroys a previously created hash table(s). A hash table can be created via the [[/hmake command - mIRC|/hmake]] command.
+
{{mirc title|/hfree Command}}
 
+
The '''/hfree''' command destroys previously created hash table(s) along with all item/data pairs within them. A hash table can be created via the {{mIRC|/hmake}} command.
 
== Synopsis ==
 
== Synopsis ==
 
  /hfree [-sw] <nowiki><table></nowiki>
 
  /hfree [-sw] <nowiki><table></nowiki>
 
 
== Switches ==
 
== Switches ==
 
* '''-s''' - Displays debug information
 
* '''-s''' - Displays debug information
* '''-w''' - Treats <nowiki><table></nowiki> as a wildcard and deletes all matching tables.
+
* '''-w''' - Treats <nowiki><table></nowiki> as a {{mirc|wildcard}} and deletes all matching tables.
 
 
 
== Parameters ==
 
== Parameters ==
 
 
* '''<nowiki><table></nowiki>''' - the table you wish to delete.
 
* '''<nowiki><table></nowiki>''' - the table you wish to delete.
 
 
== Example ==
 
== Example ==
 
<syntaxhighlight lang="mIRC">alias del_hash {
 
<syntaxhighlight lang="mIRC">alias del_hash {
Line 28: Line 24:
 
}</syntaxhighlight>
 
}</syntaxhighlight>
  
== Compatibility ==
+
<source lang="mIRC">
Added: mIRC v5.8
+
//hfree -s test | hfree -s test | echo -a test message
 +
* When not using the -w switch, trying to free a non-existent table is an error which halts execution of a script, so the echo does not display
  
Added On: 05/09/2000
+
//hfree -sw test | hfree -sw test | echo -a test message
 
+
* Using the -w switch allows deleting zero tables matching the wildcard, enabling the echo to display.
 
+
</source>
 
 
<small>Note: Individual switches were not taken into consideration.</small>
 
  
 +
== Compatibility ==
 +
{{mIRC compatibility|5.8}}
 
== See also ==
 
== See also ==
* [[List of commands - mIRC|List of commands]]
+
{{collist
* [[List of identifiers - mIRC|List of identifiers]]
+
|count = 3
* [[$hfind identifier - mIRC|$hfind]]
+
|style = width: 60%; display: inherit;
* [[$hget identifier - mIRC|$hget]]
+
|
* [[/hadd command - mIRC|/hadd]]
+
* {{mIRC|/hmake}}
* [[/hdec command - mIRC|/hdec]]
+
* {{mIRC|/hload}}
* [[/hdel command - mIRC|/hdel]]
+
* {{mIRC|/hsave}}
* [[/hinc command - mIRC|/hinc]]
+
* {{mIRC|Hash Tables}}
* [[/hload command - mIRC|/hload]]
+
* {{mIRC|/hadd}}
* [[/hmake command - mIRC|/hmake]]
+
* {{mIRC|/hdel}}
* [[/hsave command - mIRC|/hsave]]
+
* {{mIRC|/hinc}}
{{mIRC command list}}
+
* {{mIRC|/hdec}}
 
+
* {{mIRC|$hget}}
[[Category:MIRC commands]]
+
* {{mIRC|$hfind}}
 +
}}

Revision as of 14:13, 20 October 2018

The /hfree command destroys previously created hash table(s) along with all item/data pairs within them. A hash table can be created via the /hmake command.

Synopsis

/hfree [-sw] <table>

Switches

  • -s - Displays debug information
  • -w - Treats <table> as a wildcard and deletes all matching tables.

Parameters

  • <table> - the table you wish to delete.

Example

alias del_hash {
  ;makes the hash table 'hash'
  hmake hash
  echo -a $hget(hash) : $hget(hash).size
  ;makes the hash table 'h' with 10 buckets
  hmake h 10
  ;makes the hash table 'has' with 20 buckets
  hmake has 20
  ;deletes hash table 'hash'
  hfree -s hash
  echo -a $hget(h) : $hget(h).size - $hget(has) : $hget(has).size
  ;deletes any hash tables matching h*
  hfree -sw h*
}
//hfree -s test | hfree -s test | echo -a test message
* When not using the -w switch, trying to free a non-existent table is an error which halts execution of a script, so the echo does not display
 
//hfree -sw test | hfree -sw test | echo -a test message
* Using the -w switch allows deleting zero tables matching the wildcard, enabling the echo to display.

Compatibility

Added: mIRC v5.8
Added on: 05 Sep 2000
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.

See also