From WikiChip
Editing mirc/commands/hdec

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|/hdec Command}}
+
{{mirc title|/hdec Command}}{{mIRC menu}}
The '''/hdec''' command decreases the value of a hashtable item by [num]. If the optional number value is not specified, the default increment value is 1. It uses the same syntax as /hadd except -b's &binvar is the [num] parameter not the destination.
+
The '''/hdec command''' decreases the value of a key by [num]. If the value is not specified, the default value is 1.0.
 +
 
 
== Synopsis ==
 
== Synopsis ==
/hdec [-m[N]szuN] <nowiki>‹table›</nowiki> <item> [num]
+
/hdec [-mszu#] <table> <key> [num]
/hdec -b[m[N]szuN] <nowiki>‹table></nowiki> <item> <&bvar>
+
 
 +
/hdec -b[cmszu#] <table> <key> <&bvar>
 +
 
 
== Switches ==
 
== Switches ==
* '''-m[N]''' - Creates the hash table if it does not exist, optionally setting the number of buckets to N. (Valid N 1-10000)
+
* '''-m''' - Creates the hash table if it does not exist  
 
* '''-s''' - Displays the assignment information  
 
* '''-s''' - Displays the assignment information  
* '''-b''' - uses the .text contents of a &binvar as the [num] parameter.
+
* '''-b''' - Treats the value as a binary variable
* '''-z''' - After setting the data's value, decreases the value by 1 each second; unsets to prevent the data value being zero or negative
+
* '''-c''' - Truncates the &bvar at the first null value
* '''-uN''' - Removes the hashtable item/value after N seconds
+
* '''-z''' - Decreases the value by 1.0 every second; stops at zero  
'''Note:''' If hashtable item has a non-zero $hget(table,item).unset property due to using -uN or -z switches when created or modified by /hinc /hdec or /hadd, then /hsave will not save that item to disk without the /hsave -u switch. /hdec preserves any existing unset delay when -z and -uN switches are not used.
+
* '''-u#''' - Removes the key/value after # seconds
 +
 
 
== Parameters ==
 
== Parameters ==
* '''<nowiki><table></nowiki>''' - The handle name of the table containing the 'item'
+
* '''<table>''' - The handle name of the table to operate on
* '''<item>''' - The item name associated with the data value
+
* '''<key>''' - The key associated with the value  
* '''[num]''' - The optional value by which to decrease the data value. If not present, decreases by 1.0
+
* '''[num]''' - The value to decrease the value by
* '''<&bvar>''' - The binary variable containing the value by which to decrease the 'item'
+
* '''<&bvar>''' - The binary variable value to decrease the value by
 +
 
 
== Example ==
 
== Example ==
'''Note:''' For more examples see the {{mIRC|/hinc}} page. /hdec is the same as /hinc except for decrementing by [num] instead of incrementing.
 
 
 
<syntaxhighlight lang="mIRC">alias countdown {
 
<syntaxhighlight lang="mIRC">alias countdown {
 
   ;adds the item down with a value of 10 to the table count
 
   ;adds the item down with a value of 10 to the table count
Line 40: Line 43:
 
== Compatibility ==
 
== Compatibility ==
 
{{mIRC compatibility|6.0}}
 
{{mIRC compatibility|6.0}}
 +
 
== See also ==
 
== See also ==
* {{mIRC|/hmake}}
+
* [[List of commands - mIRC|List of commands]]
 +
* [[List of identifiers - mIRC|List of identifiers]]
 +
* {{mIRC|$hget}}
 +
* {{mIRC|$hfind}}
 +
* {{mIRC|/hadd}}
 +
* {{mIRC|/hdel}}
 
* {{mIRC|/hfree}}
 
* {{mIRC|/hfree}}
 +
* {{mIRC|/hinc}}
 
* {{mIRC|/hload}}
 
* {{mIRC|/hload}}
 +
* {{mIRC|/hmake}}
 
* {{mIRC|/hsave}}
 
* {{mIRC|/hsave}}
* {{mIRC|/hadd}}
+
{{mIRC command list}}
* {{mIRC|/hdel}}
+
 
* {{mIRC|/hinc}}
+
[[Category:mIRC commands|hdec 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)