FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Explore Yunus and FW_dbftoarray and FW_SaveArrayToDBF
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Explore Yunus and FW_dbftoarray and FW_SaveArrayToDBF
Posted: Wed Aug 30, 2023 09:51 AM

I was exploring Yunus and how to retrieve invoice items, update en save.

These function are used, but i'm not that sure yet.

These functions are based on a recno() that is added and depending on the delete status of a invoice item.

Deleted items are NOT taken by the function and so only GOOD items will come into the invoice. When adding and changing data, the save function will write back

and change the values.

Is it save to think that this process is 100% fullprove ? Will the recno's not change when deleting of adding items to the invoice that will be saved ?

Do I have to delete the items so now and then in a separate maintenance procedure where all deleted invoice items will be erased for sure ?

Before save this code is done in Yunus.

     if ! Empty( oBrw:aDeleted )

        AEval( oBrw:aDeleted, { |a| a[ 9 ] := -a[ 9 ] } )

        IIT->( FW_SaveArrayToDBF( cItemFlds, oBrw:aDeleted ) )

     endif

What is the AEval doing ?

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Explore Yunus and FW_dbftoarray and FW_SaveArrayToDBF
Posted: Wed Aug 30, 2023 10:04 AM
Is it save to think that this process is 100% fullprove ?
Yes. Safe and 100% full-proof.
You need to carefully study the functions used carefully to appreciate the logic.
Will the recno's not change when deleting of adding items to the invoice that will be saved ?
This is the basic behavior of DBFs.
When records are deleted, recno()s do not change. Only deleted flag will be set for the records.
The RecNo()s will change only when the DBF is "PACKED".
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion