<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 5, 2015 at 2:11 AM, silvioprog <span dir="ltr"><<a href="mailto:silvioprog@gmail.com" target="_blank">silvioprog@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">What do you think about a TDataSetEnumerator class in the DB unit? Something like this:<div><br></div><div>=== begin code ===</div><div><div> </div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>function TDataSetEnumerator.MoveNext: Boolean;<div><div>begin</div><div> Inc(FPosition);</div><div> if FPosition = FDataSet.RecordCount then</div><div> Exit(False);</div><div> FDataSet.MoveBy(FPosition);</div><div> Result := True;</div><div>end;</div></div></div></div></blockquote><div><br><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">I'm not sure for FPC but in Delphi there are datasets that do not fully implement the properties .RecNo and .RecordCount, server cursor datasets for
example always return -1 if memory serves. IMHO the .MoveNext method should be written
in such a way as to not use .RecordCount but only .Eof which is the only property
that is guaranteed to always work correctly in all datasets.<br><br></div>--<div class="gmail_default" style="font-family:trebuchet ms,sans-serif;display:inline"> </div>Constantine</div></div></div></div>