[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Weird things w/Packages and with do statements

Posted on 1998-06-05
4
Medium Priority
?
255 Views
Last Modified: 2010-04-06
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.

Example:
procedure InsertStoreInfo;
var
  inItem_id: integer;
begin
  with qryAccountInfo do
  begin
    qryStoreAccnts.First;  <<place break point here
    While not qryStoreAccnts.EOF do
    begin
      Insert;
      FieldByName('store').Value :=   qryStoreAccnts.FieldByName('location_id').Value;
      FieldByName('acct_id').Value := qryStoreAccnts.FieldByName('store_acct').Value;
      qryStoreAccnts.Next;
    end;
  end;
  FItemInsert := false;
end;

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)
0
Comment
Question by:rickpet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1350718
Hi

I have had this behaviour before.  In my case it went away after I did the following:
1)  View Breakpoints (on View menu) and remove ALL break points.
2)  Close Delphi (I rebooted my PC too, just for good measure :)
3)  Load Delphi & project, and Build All.

That fixed it for my specific problem, which was also a program with many packages (total build of 352000 lines).

Cheers,
JB
0
 
LVL 3

Author Comment

by:rickpet
ID: 1350719
JimBob...

seems that fixed the problem...Oh how I hate packages...

So...we will be very careful while using breakpoints.  Like deleting them between builds...So give us an answer and I'll grade you. =)-~

Thanks Rick

0
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 200 total points
ID: 1350720
Hi Rick

Here is the answer you requested, but don't grade it until you're 100% happy that your problem is fixed.

Cheers,
JB
0
 
LVL 3

Author Comment

by:rickpet
ID: 1350721
Nope...pretty happy...went and recreated the problem...seems to have fixed it...probably somehow the IDE and the code are getting out of synch...Breakpoints and with statements just make the situation worse...

Thanks...tried everything but deleting the breakpoints...

Rick
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question