I would like to have a function that opens an archive and sets a series of indexes
I tried to do this function but it doesn't turn me at all I don't understand where I'm wrong
sample of Usage
oCustomers:Open_Db( "customer", , {FIRST,LAST} )
oCustomers:SetOrder( "FIRST" )
oCustomers:GoTop()
return me a message "TD0001.dbf not avaible"
then I tried with
but make error because
Error description: Error DBCMD/2001 Workarea not in use: ORDLISTADD
Stack Calls
===========
Called from: => ORDLISTADD( 0 )
Called from: ../../../rddord.prg => DBSETINDEX( 0 )
what do you recommend?
I tried to do this function but it doesn't turn me at all I don't understand where I'm wrong
sample of Usage
oCustomers:Open_Db( "customer", , {FIRST,LAST} )
oCustomers:SetOrder( "FIRST" )
oCustomers:GoTop()
FUNCTION Open_Db( cArchivio, aIdx )
LOCAL cAlias
LOCAL oDbf
LOCAL i
STATIC _Select_
DEFAULT _Select_ := 0
cAlias := "TD" + PADL( ++_Select_, 3, "0" )
DbUseArea( .T. ,, cArchivio, cAlias, .T. )
IF VALTYPE( aIdx ) == "A"
FOR i := 1 TO LEN( aIdx )
DBSETINDEX( aIdx[ i ] )
NEXT
ENDIF
oDbf := TDatabase():Open(,cAlias)
RETURN oDbfreturn me a message "TD0001.dbf not avaible"
then I tried with
FUNCTION Open_Db( cArchivio, aIdx )
LOCAL cAlias
LOCAL oDbf
LOCAL i
STATIC _Select_
DEFAULT _Select_ := 0
oDbf := TDatabase():Open(,cArchivio)
IF VALTYPE( aIdx ) == "A"
FOR i := 1 TO LEN( aIdx )
DBSETINDEX( aIdx[ i ] )
NEXT
ENDIF
RETURN oDbfbut make error because
Error description: Error DBCMD/2001 Workarea not in use: ORDLISTADD
Stack Calls
===========
Called from: => ORDLISTADD( 0 )
Called from: ../../../rddord.prg => DBSETINDEX( 0 )
what do you recommend?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com