Explore Yunus and FW_dbftoarray and FW_SaveArrayToDBF

Explore Yunus and FW_dbftoarray and FW_SaveArrayToDBF

Postby Marc Venken » Wed Aug 30, 2023 9: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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1426
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Explore Yunus and FW_dbftoarray and FW_SaveArrayToDBF

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 46 guests