Page 1 of 1

Another test with FW_DbfToArray

Posted: Sat Jul 20, 2019 4:36 pm
by Silvio.Falconi
then the test helped from Uwe on this topic

http://forums.fivetechsupport.com/viewt ... 64#p223944

I thinked to not delete the records but add a new field TACANCEL to set wich record i can delete on second time
because then must be seen by final user before to delete
so, after saved the records I wanted create an array for only records having oTariffe:TACANCEL=.F.

if I make

Code: Select all

 local cFieldList :="TATIPO,TAELEMENTO,TADESCELEM,TASERVIZIO,TADESCSERV,TASERVSTRU,TASETTORE,TAGIORNI,TADATEINI,TADATEFIN,TACOSTO,TASCONTO,TALISTINO,TABLOCCATO,TATARIFFA,TATOTALE,TACANCEL"

 atemp:=oTariffe:FW_DbfToArray( cFieldList, { || oTariffe:TACANCEL=.F.  } )

the procedure not run ok, so on atemp array the procedure insert all records of Tariffe.dbf


then I try the same with the old method

Code: Select all

  

DO WHILE !oTariffe:EOF()
        IF oTariffe:TACANCEL=.F.
         AaDd(atemp, {  oTariffe:TaTipo     ,;
                         oTariffe:TaElemento ,;
                         oTariffe:TaDescElem ,;
                         oTariffe:TaServizio ,;
                         oTariffe:TaDescServ ,;
                         oTariffe:TaServStru ,;
                         oTariffe:TaSettore  ,;
                         oTariffe:TaGiorni   ,;
                         oTariffe:TaDateIni  ,;
                         oTariffe:TaDateFin  ,;
                         oTariffe:TaCosto    ,;
                         oTariffe:TaSconto   ,;
                         oTariffe:TaListino  ,;
                         oTariffe:TaBloccato ,;
                         oTariffe:TaTariffa  ,;
                         oTariffe:TaTotale,oTariffe:TACANCEL   }  )
           ENDIF
        oTariffe:Skip()
     ENDDO
    oTariffe:close()
 


and finally on aTemp is showed the records I wish be showed

Image


but in me there remains the desire to understand why with FW_DbfToArray it didn't work as I wanted it to do