to simplify the Tdatabase call

to simplify the Tdatabase call

Postby Silvio.Falconi » Mon May 17, 2021 8:18 am

I wanted to know if in Tdatabase I can do this

sample

CLASS TUtenti from TDataBase
METHOD New()
METHOD ToArray()
ENDCLASS

METHOD New( lShared ) CLASS TUtenti
Default lShared := .t.
::super:New(,oApp():cExePath + "Utenti" ,, lShared)
if ::use()
::setOrder(1)
::gotop()
endif
RETURN Self

METHOD ToArray(aTmp) CLASS TUtenti
if ::use()
aTmp:=ARRAYTODBF()
endif
RETURN aTmp


because I have some function I use often on all procedures and I ask I can insert on each class ,
but for a sample I not Know How save the field to array with arraytodbf until nos I used fw_arratodbf ( exclusive)

ANY SOLUTION ?
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
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: to simplify the Tdatabase call

Postby James Bott » Thu May 20, 2021 11:33 pm

Silvio,

I thought you already had this working? And the way you show it you care creating and array with every field, and I thought you only needed 3 fields?
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: to simplify the Tdatabase call

Postby Silvio.Falconi » Fri May 21, 2021 5:20 am

James,
I resolved but I not use arraytodbf but to hand
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
Silvio.Falconi
 
Posts: 6849
Joined: Thu Oct 18, 2012 7:17 pm

Re: to simplify the Tdatabase call

Postby James Bott » Fri Jun 04, 2021 10:51 pm

Silvio,

I resolved but I not use arraytodbf

Hmm, doesn't arraytodbf() take an array and put it into a DBF? I think you want DBFtoArry() if there is such a method.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 28 guests