Weird things w/Packages and with do statements
Posted on 1998-06-05
Okay the situation.
Delphi 3 C/S. The program is compiled with packages(matter of fact with about 10 packages in total not including Borland's).
It seems that under specific conditions, the IDE looses it's place when stepping through code. This sometimes happens if you place a break point inside of a with do statement.
with qryAccountInfo do
qryStoreAccnts.First; <<place break point here
While not qryStoreAccnts.EOF do
FieldByName('store').Value := qryStoreAccnts.FieldByName('location_id').Value;
FieldByName('acct_id').Value := qryStoreAccnts.FieldByName('store_acct').Value;
FItemInsert := false;
If you placed a break point at First, it would show EOF true. Even though there was one record in the underlying table.
What was happening is that the code was actually getting to the insert, even though the breakpoint showed that it was stopped on First. When insert was being called their was some code to stop newrecords(abort) which was causing our EOF to be true;
The solution was to yank the with do part of the code...The ide actually stopped on first...and showed EOF to false. Stepping through showed the abort to be called...aha...problem solved.
Boy I pulled my hair out until I figured it was bypassing my breakpoint...
Anyone else seen this behavior???Anyway to stop it and keep my with do's???(Yes I did a build all, and had new dpl's for the rest of the project)