xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HMerge()

Merges the contents of an entire hash into another hash.

Syntax

HMerge( <hTarget>, <hSource>, [<xMode>]) --> hTarget

Arguments

<hTarget>
A variable referencing the hash that receives key/value pairs from <hSource>.
<hSource>
A variable referencing the hash to merge into <hTarget>.
<xMode>
<xMode> is either a numeric value or a code block. It specifies how to treat duplicate keys in both hashes. The default value is 0.

Return

The function returns a reference to <hTarget>.

Description

This function merges the entire contents of the hash <hSource> into the hash <hTarget>, depending on the value of <xMode>.

This function is a shortcut for:

HCopy( <hSource>, <hTarget>, 1, Len(<hSource>), <xMode> )

Note that <hTarget> and <hSource> are used in different order with HCopy() and HMerge().

For a description of parameter <xMode> refer to function HCopy().

Info

See also:HCopy()
Category: Hash functions , xHarbour extensions
Source:vm\hash.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// See the example for HCopy()

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe