hb_HKeyAt()

HB_HKEYAT()

Gets a hash table key at a given position

Syntax

      HB_HKEYAT( <hsTable>, <nPosition> ) -> <Key>

Arguments

<hsTable> a hash table, created by HB_HASH()

<nPosition> 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

Compliance

Harbour

hb_HHasKey()

HB_HHASKEY()

Determines whether a hash table has an entry with a give key

Syntax

      HB_HHASKEY( <hsTable>, <Key> ) -> lExists

Arguments

<hsTable> a hash table, created by HB_HASH()

<Key> 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

Compliance

Harbour

hb_HGetDef()

HB_HGETDEF()

Returns a hash value, or a default value if the key is not present

Syntax

      HB_HGETDEF( <hsTable>, <Key>, [<DefaultValue>] ) -> <Value>

Arguments

<hsTable> a hash table, created by HB_HASH()

<Key> key to be retrieve from the hash table; can be of type: number, date, datetime, string, pointer

<DefaultValue> 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.

Compliance

Harbour

hb_HGet()

HB_HGET()

Returns a hash value

Syntax

      HB_HGET( <hsTable>, <Key> ) -> <Value>

Arguments

<hsTable> a hash table, created by HB_HASH()

<Key> 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

Compliance

Harbour

hb_HFill()

HB_HFILL()

Fills a hash table with a value

Syntax

      HB_HFILL( <hsTable>, <Value> ) -> <hsTable>

Arguments

<hsTable> a hash table, created by HB_HASH()

<Value> fill value; can be of type: block, string, numeric, date/datetime, logical, nil, pointer, array, hash table

Returns

The hash table

Compliance

Harbour

hb_HEval()

Arguments

<hsTable> a hash table, created by HB_HASH()

<bBlock> code block to be evaluated

<nStart> starting index, defaults to 1 if omitted

<nCount> counter, defaults to (length) – <nStart> is omitted

Returns

The hash table

Description

The code block is evaluated for every hash table entry starting at <nStart> for <nCount> items.

The code block is passed the entry key, value, and numeric position

Compliance

Harbour

hb_HDelAt()

HB_HDELAT()

Removes an entry from a hash table based on its index position

Syntax

      HB_HDELAT( <hsTable>, <nPosition> ) -> <hsTable>

Arguments

<hsTable> a hash table, created by HB_HASH()

<nPosition> the position of an entry within the hash table that will be deleted

Returns

The hash table

Compliance

Harbour

hb_HDel()

HB_HDEL()

Removes a key/value pair from a hash table

Syntax

      HB_HDEL( <hsTable>, <Key> ) -> <hsTable>

Arguments

<hsTable> a hash table, created by HB_HASH()

<Key> key to be removed from the hash table; can be of type: number, date, datetime, string, pointer

Returns

The hash table

Compliance

Harbour

hb_HDefault()

HB_HDEFAULT()

Returns/sets a default value for a hash table.

Syntax

      HB_HDEFAULT( <hsTable>, <DefaultValue> ) -> <OldDefaultValye>

Arguments

<hsTable> a hash table, created by HB_HASH()

<DefaultValue>

Returns

The previous default value assigned to the hash table

Compliance

Harbour

hb_HCopy()

HB_HCOPY()

Adds entries from the source hash table to the destination hash table

Syntax

      HB_HCOPY( <hsDestination>, <hsSource>, [<nStart>], [<nCount>] )
                 -> <hsDestination>

Arguments

<hsDestination> a destination hash table, created by HB_HASH()

<hsSource> a source hash table, created by HB_HASH()

<nStart> starting index, defaults to 1 if omitted

<nCount> counter, defaults to (length) – <nStart> is omitted

Returns

The destination hash table

Compliance

Harbour