On Tue, 21 Apr 2009, Adam Lubszczyk wrote:

Hi,

> I do not create index - it's not problem.
> If I in ADS make index - all work OK.

I do not think so. This index is not binary compatible with CDX format.
It can be open by ADS and also by Harbour if we remove some index type
validation which now generates RT error.

> I must open existing index (only for read) maked by aplication of VFP.
> Standard Harbour DBFCDX can't open this CDX.

Intentionally. It's not CDX format. Yet another undocumented MS extensions.
Fortunately here it can be easy implemented on all platforms so I can add
support for this extensions to core code.

> ADS open this CDX and work OK except order on field type INTEGER
> ( STR(field_integer) work OK )

And this index uses internally non CDX format. Harbour nicely
detects it and generate RT error. ADS open it because it does
not validate key size but it does not know anything about this
format so index does not work correctly. IMHO Harbour behavior
is correct.
It's also an answer about using CDX indexes with some VFP/MS-Win
only extension in ADS. Looks that it does not work what is
rather expected behavior.
In exactly this case MS hacked format of numbers stored in index
file and it's very easy to guess what they exactly did so I can
add support for such indexes to Harbour to all builds without
any problem because I do not have to touch windows API.
I'll commit it but it will not help you in any way in character
indexes which can be open but they still will not work correctly.
Add to your test code this few lines to see what happens with
character keys in VFP indexes.

   ordSetFocus(2)
   dbgotop()
   while !eof()
      ? &(ordKey()), ordKeyVal()
      dbskip()
   enddo
   inkey(0)

For read only mode you can use such indexes with "EN" codepage
because the keys are already in binary format which should be
sorted without any national characters.

> Another problem with ADS is not work with "CODEPAGE" extension

Any indexes with this undocumented VFP extensions will not play well
with different codepages. They are hardcoded to Windows API, Windows
codepages and MS national collating hash function which is not public
and not compatible with Unicode universal collating algorithm.
I do no think that ADS will fully support such indexes but I could be
wrong. Just ask Extended System about it and what they use for non
Windows ADS ports. It can be very interesting information.

My personal advice:
Drop any tools which are not binary compatible with documented standard.
If MS is not able to keep the standards then it's time to migrate from
MS environment to some more professional solutions.

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to