Creation Array from Tdatabase

Post Reply
User avatar
Silvio.Falconi
Posts: 7138
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Creation Array from Tdatabase

Post by Silvio.Falconi »

I need to create on Memory an array from a database

I need to insert several conditions

Now I tried making a filter

oConteggio:=TDatabase():Open( , "Lotto", "DBFCDX", .T. )

IF nLastRecords > 0
nInit:=oConteggio:lastrec()-nLastRecords
nEnd:= oConteggio:lastrec()
ENDIF

oConteggio:Exec( <||
SET FILTER TO ( dFirst <= FIELD->DATA .AND. ;
dLast >= FIELD->DATA .AND. ;
aCountMesi[ MONTH( FIELD->DATA ) ] .AND. ;
aCountGiorni[ DOW( FIELD->DATA )-1 ] .AND. ;
aCountDate[ DAY( FIELD->DATA ) ] .AND. ;
aCountIndici[ FIELD->IDX ] )
return nil
> )

where I insert the conditions on FW_Dbftoarray function ?

thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Creation Array from Tdatabase

Post by nageswaragunupudi »

Code: Select all | Expand

function FW_DbfToArray( cFieldList, bFor )
Give your filter condition in the second parameter ( bFor ) as a codeblock
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7138
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Creation Array from Tdatabase

Post by Silvio.Falconi »

nageswaragunupudi wrote:

Code: Select all | Expand

function FW_DbfToArray( cFieldList, bFor )
Give your filter condition in the second parameter ( bFor ) as a codeblock
Thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
Post Reply