Page 1 of 1

to simplify the Tdatabase call

Posted: Mon May 17, 2021 8:18 am
by Silvio.Falconi
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 ?

Re: to simplify the Tdatabase call

Posted: Thu May 20, 2021 11:33 pm
by James Bott
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?

Re: to simplify the Tdatabase call

Posted: Fri May 21, 2021 5:20 am
by Silvio.Falconi
James,
I resolved but I not use arraytodbf but to hand

Re: to simplify the Tdatabase call

Posted: Fri Jun 04, 2021 10:51 pm
by James Bott
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