Page 1 of 1

Undo transactions

PostPosted: Tue Mar 19, 2019 12:47 pm
by dhs
MFM wrote:
PROCEDURE UndoStartTransaction; BUILTIN 634;
PROCEDURE UndoEndTransaction; BUILTIN 635;

These procedures mark the beginning and end of what the undo system sees as a "transaction".

For example, when creating a single line, the undo system sees the following:

- An entity was added
- It was drawn to the screen
- It was marked as the end of a "group"

These 3 steps are seen as a single "transaction" and will be "un-done" together.


I'm not entirely clear on the use of these procedures, but I'm assume that they can be used to break what the undo system would otherwise see as a single transaction into multiple transactions. (e.g. if I have a macro that updates a polyline and then updates some text in the same operation, I could wrap each of those discreet pieces of code in a UndoStartTransaction/UndoEnd transaction block so that the undo logic would treat them as 2 separate operations) ?

I have not been able to find anything in DCAL for Delphi that looks equivalent to these procedures ... is there a D4D equivalent ?

Re: Undo transactions

PostPosted: Fri Mar 22, 2019 11:05 am
by Mark F. Madura
The undo start/end procedures have not been exported to DCAL for Delphi / C++. However, the following functions will be made available in the next update to DataCAD 21.

DCAL for Delphi
undoStartTransaction();
undoEndTransaction();

DCAL for C++
undoStartTransaction();
undoEndTransaction();

Re: Undo transactions

PostPosted: Fri Mar 22, 2019 11:48 am
by dhs
Thank you Mark.