Now I wish converte it for use with tdatabase and I have some problems
When the user slect the combox the the procedure create an Expression (cExpression)
sample : upper(code1)+name+DTOS(date)
TO create the index on oldest release I made
- Code: Select all Expand view RUN
IF! ldescend
INDEX ON &cExpression TAG neworder FOR !DELETED() MEMORY ADDITIVE
ELSE
INDEX ON DESCEND(&cExpression) TAG neworder FOR !DELETED() MEMORY ADDITIVE
Endif
With Tdatabase oDbf
local cfor := "!Deleted()"
local bFor := "{ || " + cfor + "}"
//take the fields
cExpression:=""
IF !Empty(cField1 ) .and. !Empty(cField2 ) .and. !Empty(cField3)
cExpression:=(cCampo1 +'+'+cCampo2+'+'+cCampo3)
elseif !Empty(cField1 ) .and. !Empty(cField2 )
cExpression:=(cCampo1 +'+'+cCampo2)
elseif !Empty(cField1 )
cExpression:=(cCampo1)
Endif
//ordcreate
bCode := "{ || " + cExpression + "}"
OrdCondSet(cFor,bFor,,,,, RECNO(),,,, )
OrdCreate( , cneworder, cExpression, &bCode )
but give me an error
Workarea not in use: ORDCREATE
but if I made ?oDbf:used give me .t.
How I can resolve it ?
I tried also with
cIndexFile := "temp.cdx"
cTagName := cneworder
cIndexKey := cExpression
bIndexKey := &bCode
lUnique := .f.
lAdditive :=.t.
OrdCreate(cIndexFile ,cTagName ,cIndexKey , bIndexKey , lUnique ,lAdditive )