tfcallahan
asked on
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 :)
E.G.
>>
If MyCondition then
Pause and go into debug mode
endif
Used to be 2nd nature but been a while :)
That's not possible.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
ASKER
Split points. Hope that's cool. Thanks!
I knew it was simple, just getting old I think :)
I knew it was simple, just getting old I think :)
That's cool and BTW I'm 70 lol.
ASKER
p.s. re debug.assert, even better. Wish I could give more points but saw it late... :(
I'm happy with half.
I'm older than you MartinLiss, so I deserve more points :>)