Subject BufferEof never comes to TRUE if ib_dataset.next method is also used in loop
Author Cagatay Tengiz
When I construct a 'while do begin' loop sth like :

IBO_Query.BufferFirst;
IBO_Query.First;
while not IBO_Query.BufferEof do begin
//do sth...
IBO_Query.BufferNext;
IBO_Query.Next;
end;

BufferEOF never comes to 'TRUE' state.. When I remove 'IBO_Query.Next' it
works as expected.

Is it as designed or a bug?

If anyone needs more information what am I doing is I am trying to write a
'master - detail - detail record copy procedure'.
And this is the actual code :

//First copy master data
dtAna := qyAna.Fields.RowData;
//Allocate space for the first detail data. How many records do we have?
SetLength(dtRecOpr, qyRecOpr.BufferRowCount);
OprSay := 0;

SetLength(dtRecOprGiren, qyRecOpr.BufferRowCount);
SetLength(dtRecOprCikan, qyRecOpr.BufferRowCount);
//Begin to copy first detail set
qyRecOpr.BufferFirst;
qyRecOpr.First;
while not (qyRecOpr.BufferEof) do begin
dtRecOpr[OprSay] := qyRecOpr.BufferFields.RowData;
//Now begin to copy second level detail set - First One
//Get how many records in detail set, and allocate space for the
records
SetLength(dtRecOprGiren[OprSay], qyRecOprGiren.BufferRowCount);
MlzSay := 0;
qyRecOprGiren.BufferFirst;
while not qyRecOprGiren.BufferEof do begin
dtRecOprGiren[OprSay, MlzSay] := qyRecOprGiren.BufferFields.RowData;
inc(MlzSay);
qyRecOprGiren.BufferNext;
end;
//And begin to copy another second level detail set - Second One
SetLength(dtRecOprCikan[OprSay], qyRecOprCikan.BufferRowCount);
CikSay := 0;
qyRecOprCikan.BufferFirst;
while not qyRecOprCikan.BufferEof do begin
dtRecOprCikan[OprSay, CikSay] := qyRecOprCikan.BufferFields.RowData;
inc(CikSay);
qyRecOprCikan.BufferNext;
end;
inc(OprSay);
qyRecOpr.BufferNext;
//Now really move to next record in order to get the secon level
detail datasets have actual records we are trying to copy
qyRecOpr.Next;
end;

Çağatay Tengiz
System Development & MIS Manager
Etap Endüstri ve Yatırım Holding A.Ş.

c.tengiz@... (for business only)
tmd0307@... (for yahoo groups only)

Tel : +90 232 479 10 66 / 139
Fax: +90 232 479 05 04


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com