![]() |
#1
|
|||
|
|||
![]()
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. |
#2
|
||||
|
||||
![]()
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:
http://forum.oberonplace.com/showpos...08&postcount=6 Welcome to the forum and best of luck, -Shelby |
#3
|
|||
|
|||
![]()
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. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |