OberonPlace.com Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old 16-06-2009, 13:39
DebG
Guest
 
Posts: n/a
Default BeginCommandGroup/EndCommandGroup

I have been experimenting with these commands using the code shown in this thread (boostStart and boostFinish). It works great with X4. But with CorelDraw 12, I can Undo OK though several calls to my macro, but when I try to back out the undos using Redo, CorelDraw freezes after 2 or 3 Redos.

I'm wondering if this is a known CorelDraw12 issue. Has anyone else come across this? Is there a workaround?
Reply With Quote
  #12  
Old 16-06-2009, 13:51
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

those two boost* functions should be paired and called appropriately: if boostStart is called with a text parameter then it opens undo-group which should be closed with boostFinish True, in which case no premature exit from the macro is allowed (use "boostFinish true:exit sub" or "goto closeUndo" with "closeUndo: boostFinish true" at the end of macro sub). And if the macro is stopped due to some run-time error (no object selected or anything) the undo-groupping is messed up. To prevent the code from bailing out use error-checking or if it's too cumbersome just add "on error resume next" as the first line of each macro that uses undo-grouping (boost* as well)

Edit: maybe your macro is using some features of X3/X4 not implemented or otherwise different from v12...

Last edited by wOxxOm; 17-06-2009 at 01:46.
Reply With Quote
  #13  
Old 17-06-2009, 13:37
DebG
Guest
 
Posts: n/a
Default

I checked carefully that there is no exit between boostStart "myMacro" and boostFinish True, and just to be sure I added On Error Resume next. As before, the macro executes perfectly, I can Undo several executions, and Redo the first one before CorelDraw freezes on the second. The macro was written in CoredDraw 12, so it can't be using any new X4 features.

It then occured to me that the number of Undo levels set in Options could be a factor. I had it set to 99, but the number of steps within the macro probably exceeds this number. So I increased it to 199, ran the macro 5 times, did Undo5 times then ReDo 5 times and it did not freeze.

So that seems to have fixed the problem. I don't know why this didn't happen in X4, perhaps Corel made a fix in that version.

Thanks for your response!
Reply With Quote
Reply


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
refreshing / redrawing /updating the screen Rick Randall CorelDRAW/Corel DESIGNER VBA 6 08-12-2009 01:25
Stop and start screen updating? DChinell CorelDRAW/Corel DESIGNER VBA 5 16-11-2008 14:39
How can I shut off offer screen in X3? justsmilin General 1 06-07-2007 09:57
How to increase redraw speed 100 times wOxxOm Feature requests/wishlist 1 05-05-2006 20:17
How to make objects appear on the screen in real size? Alex FAQ 0 27-04-2005 11:16


All times are GMT -5. The time now is 09:42.


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