Analyse the code below
void clicked() { PurchLine tmpPurchLine; PurchLine updatePurchLine; PurchLine selectedRecord; Dialog dl; DialogField dlfTransdate; ; dl = new Dialog("Change confirmed date"); dlfTransdate = dl.addFieldValue(typeid("Transdate"),today(),"Confirmed date"); if(dl.run()){ selectedRecord = PurchLine_ds.cursor(); for (tmpPurchLine = PurchLine_ds.getFirst(true) ? PurchLine_ds.getFirst(true) : PurchLine_ds.cursor(); tmpPurchLine; tmpPurchLine = PurchLine_ds.getnext()) { ttsbegin; SELECT FORUPDATE updatePurchLine WHERE updatePurchLine.PurchId == tmpPurchLine.PurchId && updatePurchLine.VendAccount == tmpPurchLine.VendAccount && updatePurchLine.LineNum == tmpPurchLine.LineNum && updatePurchLine.ItemId == tmpPurchLine.ItemId; updatePurchLine.ConfirmedDlv = dlfTransdate.value(); updatePurchLine.update(); ttscommit; } PurchLine_ds.reread(); PurchLine_ds.research(); PurchLine_ds.findRecord(selectedRecord); } super(); }
|