xHarbour Reference Documentation > Function Reference |
Evaluates a code block with each hash element.
HEval( <hHash>, <bBlock>, [<nStart>], [<nCount>] ) --> hHash
The function returns a reference to <hHash>.
The function evaluates the code block <bBlock> with the key/value pairs of <hHash>. The code block receives three parameters: the key, the value and the numeric ordinal position of the current key/value pair in <hHash>. The return value of the code block is ignored.
See also: | AEval(), Hash(), HGetKeys(), HGetValues(), HScan() |
Category: | Code block functions , Hash functions , xHarbour extensions |
Source: | vm\hash.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The function illustrates the parameters passed to the // HEval() code block. PROCEDURE Main LOCAL hHash := Hash( "A",10, "B",20 , "C",30 , "D",40 ) HEval( hHash, {|k,v,i| QOut( k, v , i ) } ) // Output: // A 10 1 // B 20 2 // C 30 3 // D 40 4 RETURN
http://www.xHarbour.com