OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Old 23-04-2009, 11:28
Posts: n/a
Default BeginCommandGroup while debugging macro

Ok, I learnt the hard way that you must implement error trapping when using BeginCommandGroup or otherwise Corel Draw might crash.

Question now is what happens when the macro is being debugged. What happens if you hit a breakpoint between BeginCommandGroup and EndCommandGroup ? And what happens if at this point, on breakpoint, you cancel macro execution?

Lastly, in case debugging a macro with BeginCommandGroup is simply dangerous, how do you workaround? Do you use some kind of conditional compilation to disable BeginCommandGroup/EndCommandGroup when debugging?

P.S.: Sorry for the bunch of questions I just posted. I'm new to the forum (great forum!). And wasn't sure if a single post with all the subjects would have been better.
Reply With Quote
Old 23-04-2009, 12:27
shelbym's Avatar
shelbym shelbym is offline
Senior Member
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,791
Blog Entries: 13
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default BeginCommandGroup

I save this for the very end, because as you can tell you will run into issues. So write your code getting it working, then add the CommandGroup. Os has simplified this a bit with his boostStart sub. You can find it here:


Welcome to the forum and best of luck,

Reply With Quote
Old 23-04-2009, 15:17
Posts: n/a

Thanks once again Shelby!

I see, yes, it is similar to what I had in mind, using conditional compilation.

I know it is not too correct to be critic when I'm brand new to the forum, specially when I love the power of Corel VBA. I was used to the old Corel Script, I upgraded to X4 recently, and I am honestly grateful to Corel and the developers for the power of Corel VBA.

But honestly, it is, at least, a bit strange that Corel couldn't implement some kind of solution. It doesn't sound too difficult for Corel to implement some small internal code that would bracket user macros. The code could easily check if some of the "dangerous" states are enabled after the user code execution, and then automatically perform "EndCommandGroup" and "Optimization = False", etc, if needed.
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple Debugging Errors KriZa General 2 15-01-2008 15:27
Workspace X3 + Script Debugging? Sunny General 1 09-06-2006 14:13
Debugging help required Peter Clifton CorelDRAW/Corel DESIGNER VBA 2 03-03-2004 18:28

All times are GMT -5. The time now is 03:23.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com