xHarbour Reference Documentation > Function Reference |
Removes a key/value pair from the hash by its ordinal position.
HDelAt( <hHash>, <nPos> ) --> NIL
The function returns always NIL.
The function removes a key/value pair from the hash <hHash> by its ordinal position. If <nPos> is outside the valid range, a runtime error is raised. Use function HGetPos() to determine the ordinal position of a key.
See also: | Hash(), HDel(), HGet(), HGetPos(), HSet() |
Category: | Hash functions , xHarbour extensions |
Source: | vm\hash.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The function deletes a key/value pair from a hash // by ordinal position. PROCEDURE Main LOCAL hHash := Hash( "A",10, "B",20 , "C",30 , "D",40 ) HDelAt( hHash, 3 ) ? ValToPrg( hHash ) // result: { "A" => 10, "B" => 20, "D" => 40 } RETURN
http://www.xHarbour.com