/* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_Hash() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Returns a hash table $SYNTAX$ hb_Hash( [ , ], [ , ], ... ) -> hTable $ARGUMENTS$ entry key; can be of type: number, date, datetime, string, pointer entry value; can be of type: block, string, numeric, date/datetime, logical, nil, pointer, array, hash table Equivalent to: ``` hTable := { => } hTable := { => , => , => } ``` $RETURNS$ A hash table built from the initial key/value pairs $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HHasKey() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Determines whether a hash table has an entry with a give key $SYNTAX$ hb_HHasKey( , ) -> lExists $ARGUMENTS$ a hash table a key value to be queried for; can be of type: number, date, datetime, string, pointer $RETURNS$ A logical value indicating whether the key exists within the hash table $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HPos() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Locates the index of a key within a hash table $SYNTAX$ hb_HPos( , ) -> nPosition $ARGUMENTS$ a hash table key for which its position is to be determined; can be of type: number, date, datetime, string, pointer $RETURNS$ A integer number being the index position of the key within the hash table. TODO: what is the return value if the key does not exist? zero (0)? RTE? $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HGet() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Returns a hash value $SYNTAX$ hb_HGet( , ) -> $ARGUMENTS$ a hash table key to be retrieve from the hash table; can be of type: number, date, datetime, string, pointer $RETURNS$ Either the value within the hash table for the given key. An array access error occurs of the key is not found $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HGetDef() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Returns a hash value, or a default value if the key is not present $SYNTAX$ hb_HGetDef( , , [] ) -> $ARGUMENTS$ a hash table key to be retrieve from the hash table; can be of type: number, date, datetime, string, pointer a default value to be returned if the hash table does not contain the key $RETURNS$ Either the value within the hash table for the given key, or the default value. $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HSet() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Sets a hash value $SYNTAX$ hb_HSet( , , ) -> $ARGUMENTS$ a hash table the key of the entry to be set; can be of type: number, date, datetime, string, pointer the entry value $RETURNS$ The hash table $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HDel() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Removes a key/value pair from a hash table $SYNTAX$ hb_HDel( , ) -> $ARGUMENTS$ a hash table key to be removed from the hash table; can be of type: number, date, datetime, string, pointer $RETURNS$ The hash table $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HKeyAt() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Gets a hash table key at a given position $SYNTAX$ hb_HKeyAt( , ) -> $ARGUMENTS$ a hash table the position of an entry within the hash table that will be returned $RETURNS$ The key at the given position of the hash table; the type will be one: number, date, datetime, string, pointer $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HValueAt() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Gets/sets a hash value at a given position $SYNTAX$ hb_HValueAt( , , [] ) -> $ARGUMENTS$ a hash table the position of an entry within the hash table that will be returned a new value to be assigned to the hash table at the given position $RETURNS$ The existing value, or the new value if it is given $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HPairAt() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Returns a two-dimensional array of a hash table entry key/value pair $SYNTAX$ hb_HPairAt( , ) -> $ARGUMENTS$ a hash table the position of an entry within the hash table that will be returned $RETURNS$ A two-dimensional array of the key/value pair entry of the hash table $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HDelAt() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Removes an entry from a hash table based on its index position $SYNTAX$ hb_HDelAt( , ) -> $ARGUMENTS$ a hash table the position of an entry within the hash table that will be deleted $RETURNS$ The hash table $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HKeys() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Returns an array of the keys of a hash table $SYNTAX$ hb_HKeys( ) -> $ARGUMENTS$ a hash table $RETURNS$ An array of all the hash table keys $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HValues() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Returns an array of the values of a hash table $SYNTAX$ hb_HValues( ) -> $ARGUMENTS$ a hash table $RETURNS$ An array of all the hash values $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HFill() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Fills a hash table with a value $SYNTAX$ hb_HFill( , ) -> $ARGUMENTS$ a hash table fill value; can be of type: block, string, numeric, date/datetime, logical, nil, pointer, array, hash table $RETURNS$ The hash table $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HClone() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Creates a copy of a hash table $SYNTAX$ hb_HClone( ) -> $ARGUMENTS$ a hash table $RETURNS$ A cloned copy of the hash table $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HCopy() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Adds entries from the source hash table to the destination hash table $SYNTAX$ hb_HCopy( , , [], [] ) -> $ARGUMENTS$ a destination hash table a source hash table starting index, defaults to 1 if omitted counter, defaults to (length) - is omitted $RETURNS$ The destination hash table $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HMerge() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Merges a source hash table into a destination hash table $SYNTAX$ hb_HMerge( , , | ) -> $ARGUMENTS$ a destination hash table a source hash table a code block that will be evaluated for each entry within the source hash table; the code block will be passed the entry key, value and position; if the code block returns a true value, the entry will be added to the destination hash table the position of an entry within the source hash table that will be appended to the destination hash table TODO: the source code passes either a number or HB_HASH_UNION; research this $RETURNS$ The destination hash table with the contents of the source hash table merged $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HEval() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Evaluate a code block across the contents of a hash table $SYNTAX$ hb_HEval( , , [], [] ) -> $ARGUMENTS$ a hash table code block to be evaluated starting index, defaults to 1 if omitted counter, defaults to (length) - is omitted $RETURNS$ The hash table $DESCRIPTION$ The code block is evaluated for every hash table entry starting at for items. The code block is passed the entry key, value, and numeric position $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HScan() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Scans a hash table $SYNTAX$ hb_HScan( , , [], [, [] ) -> nPosition $ARGUMENTS$ a hash table to be located within the hash table starting index, defaults to 1 if omitted counter, defaults to (length) - is omitted logical value indicating whether the comparison is to be be exact or not $RETURNS$ The position of the located value within the hash table, or zero (0) if not found. $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HSort() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Reorganizes the internal list of the hash table to be sorted $SYNTAX$ hb_HSort( ) -> $ARGUMENTS$ a hash table $RETURNS$ The hash table sorted TODO: is the original table altered? $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HCaseMatch() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Sets the 'case match' flag for the hash table $SYNTAX$ hb_HCaseMatch( , [] ) -> $ARGUMENTS$ a hash table a logical value indicating to turn on or off the 'case match' flag of the hash table $RETURNS$ The previous value of the 'case match' flag $DESCRIPTION$ This function returns the old flag value $EXAMPLES$ LOCAL hsTable, lFlag hsTable := { "one" => 1, "two" => 2 } // turn 'case match' on for a new hash table, storing old flag lFlag := hb_HCaseMatch( hsTable, .T. ) $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HBinary() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Sets the 'binary' flag for the hash table $SYNTAX$ hb_HBinary( , [] ) -> $ARGUMENTS$ a hash table a logical value indicating to turn on or off the 'binary' flag of the hash table $RETURNS$ The previous value of the 'binary' flag $DESCRIPTION$ This function is equivalent to hb_HBinary() but it returns the old flag value rather than the hash table $EXAMPLES$ LOCAL hsTable, lFlag hsTable := { "one" => 1, "two" => 2 } // turn 'binary' on for a new hash table, storing old flag lFlag := hb_HBinary( hsTable, .T. ) $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HAutoAdd() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Sets the 'auto add' flag for the hash table $SYNTAX$ hb_HAutoAdd( , [] ) -> $ARGUMENTS$ a hash table a logical value indicating to turn on or off the 'auto add' flag of the hash table $RETURNS$ The previous value of the 'auto add' flag $DESCRIPTION$ This function is equivalent to hb_HAutoAdd() but it returns the old flag value rather than the hash table $EXAMPLES$ LOCAL hsTable, lFlag hsTable := { "one" => 1, "two" => 2 } // turn 'auto add' on for a new hash table, storing old flag lFlag := hb_HAutoAdd( hsTable, .T. ) $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Procedure $NAME$ hb_HAllocate() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Preallocates a hash table $SYNTAX$ hb_HAllocate( , ) $ARGUMENTS$ a hash table number of items to preallocate in the hash table $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */ /* $DOC$ $AUTHOR$ Copyright 2009 April White $TEMPLATE$ Function $NAME$ hb_HDefault() $CATEGORY$ API $SUBCATEGORY$ Hash table $ONELINER$ Returns/sets a default value for a hash table. $SYNTAX$ hb_HDefault( , ) -> $ARGUMENTS$ a hash table $RETURNS$ The previous default value assigned to the hash table $DESCRIPTION$ $EXAMPLES$ $STATUS$ R $COMPLIANCE$ H $PLATFORMS$ $FILES$ $SEEALSO$ $END$ */