[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

Invoke VB6 debugger programatticly

I need to pause a vb6 app in the ide run mode on a certain condition so I can get to the debugger.

E.G.

>>
If MyCondition then
   Pause and go into debug mode
endif

Used to be 2nd nature but been a while :)
0
tfcallahan
Asked:
tfcallahan
  • 6
  • 2
  • 2
2 Solutions
 
Martin LissRetired ProgrammerCommented:
That's not possible.
0
 
Martin LissRetired ProgrammerCommented:
Sorry, I misread your question. To be able to use the debugger you need to put a breakpoint on a line of code that gets executed. Click in the left margin of a line to set a breakpoint.
0
 
GrahamSkanCommented:
Use the Stop instruction

If MyCondition then
   Stop
endif
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Martin LissRetired ProgrammerCommented:
Both the Stop statement and a breakpoint do exactly the same thing, but be cautious with the Stop. If it's accidentally left in an exe it will be translated as an End and when ejected the program will end.
0
 
Martin LissRetired ProgrammerCommented:
You can also use the Assert statement which is ignored when compiled. Here's what MSDN has to say about Assert.


A Debug.Assert statement will never appear in a compiled application, but when you're running in the design environment it causes the application to enter break mode with the line containing the statement highlighted (assuming that the expression evaluates to False). The following example shows the Debug.Assert statement:

Debug.Assert Trim(CustName) = "John Doe"

In this case, if the CustName isn't John Doe, the application will enter break mode; otherwise the execution will continue as usual. Using Debug.Assert is similar to setting a watch with the Break When Value Is True option selected, except that it will break when the value is false.
0
 
tfcallahanAuthor Commented:
Split points. Hope that's cool. Thanks!

I knew it was simple, just getting old I think :)
0
 
Martin LissRetired ProgrammerCommented:
That's cool and BTW I'm 70 lol.
0
 
tfcallahanAuthor Commented:
p.s. re debug.assert, even better. Wish I could give more points but saw it late... :(
0
 
Martin LissRetired ProgrammerCommented:
I'm happy with half.
0
 
GrahamSkanCommented:
I'm older than you MartinLiss, so I deserve more points :>)
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 6
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now