Alaska Software Inc. - FOXCDX IDSC DBZAP/DBPACK
Username: Password:
AuthorTopic: FOXCDX IDSC DBZAP/DBPACK
Nico HoubenFOXCDX IDSC DBZAP/DBPACK
on Fri, 02 Dec 2011 13:52:27 +0100
Hello Alaska,

The flowing case happend, and found something which could point alaska in 
the right direction:

Case:
An DBF + CDX (multiple tags)
The tag's together are more than 512 characters. (I'sn't allowed!???? )

Use database index database new exclusive
database->(dbzap())                                     --> IDSC

This IDSC doesn't always happen even sometimes the second/third time it goes 
on and we have a working INDEX with more than 512 characters.

Sollution which gave the correct error and no IDSC: (simple code, quick and 
dirty)

#include "DMLB.CH"

function MyZap()
local aOrdKeyList          := {}
local aOrdKeyName       := {}
local cIndexNameFull     := OrdBagName(1, DMLB_QUALIFIED_FILENAME ) 
//#include "DMLB.CH"
local cIndexName          := OrdBagName(1, DMLB_FILENAME ) //#include 
"DMLB.CH"

FOR i:=1 TO OrdCount()
   AAdd( aOrdKeyList , OrdKey(i) )
   AAdd( aOrdKeyName , OrdName(i) )
NEXT

OrdListClear()
dbzap()


FErase( cIndexNameFull )

FOR i:=1 TO Len( aOrdKeyList )
   OrdCondSet( "! Deleted()" , {|| ! Deleted() } , , , , , , , , , , .T.   )
   OrdCreate( cIndexNameFull , aOrdKeyName[i]  , aOrdKeyList[ i ] , , .T.  )
next


OrdListClear()
ordlistadd(cIndexNameFull)


aOrdKeyList := {}
aOrdKeyName := {}

FOR i:=1 TO OrdCount()
   AAdd( aOrdKeyList , OrdKey(i) )
   AAdd( aOrdKeyName , OrdName( i ) )
NEXT
Return

How to use:
Use customer index customer new exclusive
Klant->(myzap())

Kind regards,

Nico Houben