Delphi tDataSet.Append seems not to call Post. In its reference it says
Dataset methods that change the dataset state, such as Edit, Insert, or Append, or that move from one record to another, such as First, Last, Next, and Prior automatically call Post.
But I don't see the incremented RecordCount in the following code.
Memo1.Lines.Add(IntToStr(FDMemTable1.RecordCount)); // 0
FDMemTable1.Append;
Memo1.Lines.Add(IntToStr(FDMemTable1.RecordCount)); // still 0
If I insert FDMemTable1.Post after Append the result shows the RecordCount is 1.
Why not tDataSet.Append automatically call Post?
Because it would defeat the object of calling Append in the first place; if it did call Post automatically, it would result in a blank record being posted to the table with no opportunity to set its field values first. Equally, automatically calling Post after Edit, or Insert would also prevent any field values being changed by user code
The statement you quote from http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/DB_TDataSet_Post.html
is, at best, badly worded imo, since it can be mis-read to give the impression that "Dataset methods that change the dataset state, such as Edit, Insert, or Append [...] automatically call Post" at the end of the method, which is not the case for the reason I have stated. What it should say, imo, is that in common with navigation methods such as First, Last, Next & Prior, these methods will start with Post automatically being called, if necessary, on the current record before the rest of the method executes. This is because these methods always call CheckBrowseMode
as a first step and this contains the code
procedure TDataSet.CheckBrowseMode;
begin
CheckActive;
DataEvent(deCheckBrowseMode, 0);
case State of
dsEdit, dsInsert:
begin
UpdateRecord;
if Modified then Post else Cancel;
end;
dsSetKey:
Post;
end;
end;