Navigation:  Reference > Functions By Category > Hash Table Functions >

_HDICT_ITERATE_STEP()

Previous pageReturn to chapter overviewNext page

Return 1 item at time from the hash table storage

Syntax:

_HDICT_ITERATE_STEP(pHt,@pIterator,@item,@key) 

 

Parameter :  pIterator

<@pIterator>

pIterator must be passed by reference and must be NIL the first time the function is called

item and key params will receive the key and item values for each iteration

_HDICT_ITERATE_STEP() will return .T. while not reach the end of storage

 

See the following sample:

i := k := v := NIL

while _HDICT_ITERATE_STEP( pHt, @i, @v , @k)

   ? k ," -> " , v

end    

                           

NOTES:

-  pIterator MUST NOT be changed by the application

-  Items inside the hash storage are sorted in random order according with the hash algorithm so
  iterate the entire hash table will retrieve all items, but not the order in witch you stored the items

-  Remove items inside the iteration can result into a memory exception

-  Add items within the iteration can produce dupe evaluations