From WikiChip
Editing mirc/commands/hdel

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
 
{{mirc title|/hdel Command}}
 
{{mirc title|/hdel Command}}
The '''/hdel''' command deletes an item/data-value pair from an existing hash table.
+
The '''/hdel command''' deletes a key/value pair from an existing hash table.
 +
 
 
== Synopsis ==
 
== Synopsis ==
  /hdel [-sw] <nowiki><table></nowiki> <item>
+
  /hdel [-sw] <nowiki><table></nowiki> <key>
 +
 
 
== Switches ==
 
== Switches ==
* '''-s''' - Displays the Deletion action if the variable exists, displays error if table doesn't exist, no display if the table exists but the item does not.
+
* '''-s''' - Displays the assignment information
* '''-w''' - Treats <nowiki><table></nowiki> as a {{mirc|wildcard}} and deletes all matching tables.
+
* '''-w''' - Treats <nowiki><table></nowiki> as a wildcard and deletes all matching tables.
 +
 
 
== Parameters ==
 
== Parameters ==
 
* '''<nowiki><table></nowiki>''' - The table which contains the item you are deleting
 
* '''<nowiki><table></nowiki>''' - The table which contains the item you are deleting
* '''<item>''' - the item-name associated with a value to delete. Can be a {{mirc|wildcard}} when using -w switch.
+
* '''<key>''' - the key associated with a value to delete.
 +
 
 
== Example ==
 
== Example ==
 
<syntaxhighlight lang="mIRC">alias hdel_example {
 
<syntaxhighlight lang="mIRC">alias hdel_example {
Line 34: Line 38:
 
}</syntaxhighlight>
 
}</syntaxhighlight>
  
<source lang="mIRC">
 
//hfree -sw test | hadd -m1 test item1 | hadd test item* | echo -a 1st item is $hget(test,1).item | hdel -w test item* | echo  -a there are $hget(test,0).item items remaining
 
* Demonstrates that an item can be created and deleted containing an asterisk. If the -w switch is deleted, only 1 of the 2 items is deleted because of an exact item-name match with "item*".
 
 
//hfree -sw test | hmake -s test | hdel -s test itemname | echo -a message 1 | hfree -s test | hdel -s test itemname | echo -a message 2
 
* Demonstrates that deleting a non-existent item from an existing table allows the script flow to continue, but deleting an item from a non-existent table is an error halting the script flow preventing the 2nd message from displaying.
 
</source>
 
 
== Compatibility ==
 
== Compatibility ==
 
{{mIRC compatibility|5.8}}
 
{{mIRC compatibility|5.8}}
 +
 
== See also ==
 
== See also ==
* {{mIRC|/hmake}}
+
* [[List of commands - mIRC|List of commands]]
 +
* [[List of identifiers - mIRC|List of identifiers]]
 +
* {{mIRC|$hfind}}
 +
* {{mIRC|$hget}}
 +
* {{mIRC|/hadd}}
 +
* {{mIRC|/hdec}}
 
* {{mIRC|/hfree}}
 
* {{mIRC|/hfree}}
 +
* {{mIRC|/hinc}}
 
* {{mIRC|/hload}}
 
* {{mIRC|/hload}}
 +
* {{mIRC|/hmake}}
 
* {{mIRC|/hsave}}
 
* {{mIRC|/hsave}}
* {{mIRC|/hadd}}
+
{{mIRC command list}}
* {{mIRC|/hinc}}
+
 
* {{mIRC|/hdec}}
+
[[Category:mIRC commands|hdel command - mIRC]]
* {{mIRC|Hash Tables}}
 
* {{mIRC|$hget}}
 
* {{mIRC|$hfind}}
 

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)