Hi,
> I use very much FOR EACH with hash, but xHarbor use FOR EACH oEach IN hash
> ? oEach:key(), oEach:value()NEXT Harbour uses a diffren sintax, but as I can see,
> hbcompat.ch doesn't fix it. Is it possible to correct this syntax the easy way?
> Or is it code that I have to modify in all places where it appears?
xHarbour does not support hash tables in FOR EACH directly.
Instead for each item of iterated hash table it creates HASHENTRY
object which has the following public methods:
<iterator>:VALUE
<iterator>:KEY
<iterator>:HPARENT
which are initialized on each iteration.
Harbour has native support for hash tables in FOR EACH without any
intermediate objects which is much faster and uses the same interface
for all iterated types (string, arrays and hash tables).
It's possible to use:
<iterator>:__enumValue // in xHarbour it's <iterator>:VALUE
<iterator>:__enumKey // in xHarbour it's <iterator>:KEY
<iterator>:__enumBase // in xHarbour it's <iterator>:HPARENT
<iterator>:__enumIndex // in xHarbour it's HB_ENUMINDEX()
// but it cannot be used in nested
// FOR EACH loops to check outer FOR EACH
// indexes.
But as for all other types you can access hash table items directly
by <iterator> item and you do not have to use <iterator>:__enumValue
There is no way to create PP rule which can hide differences between
Harbour and xHarbour without breaking other code so there is no chance
that they can appear in hbcompat.ch
best regards,
Przemek