typically, such code does not process the whole dataset, but only the (initially) first record - because with the first ".post" it jumps to last position (because of active sorting) and the next ".next" call activates eof and the iterations stops.
Code: Select all
dataset.indexfieldnames := 'somefield';
dataset.first;
while not dataset.eof do begin
dataset.edit;
datasetsomefield.asinteger := maxint;
dataset.post;
dataset.next;
end;