| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Copies the same value into all key/value pairs.
HFILL( <Hash>, <xValue> ) --> NIL
The function returns always NIL.
The function uses a single value <xValue> and copies it to all key/value pairs of a hash. This is useful when a unified state must be achieved for all items in the hash. Use only simple data types for <xValue> (C,D,L,N).
| See also: | Hash(), HSet(), HSetValueAt(), HScan() |
| Category: | Hash functions , xHarbour extensions |
| Source: | vm\hash.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example shows the effect of HFill()
PROCEDURE Main
LOCAL hHash := { "a"=> 10, "b" => 20, "c" => 30 }
LOCAL aValues
? ValToPrg( HGetValues(hHash) ) // result: { 10, 20, 30 }
? HFill( hHash, "A" ) // result: NIL
? ValToPrg( HGetValues(hHash) ) // result: { "A", "A", "A" }
RETURN
http://www.xHarbour.com