In PowerMILL 2017 SP2. I record two macro "Dialogs On.mac" and "Dialogs Off.mac".
The command are:
1.Dialogs On.mac
DIALOGS MESSAGE ON
DIALOGS ERROR ON
2.Dialogs Off.mac
DIALOGS MESSAGE OFF
DIALOGS ERROR OFF
When I use the comands in command windows, these problem is not display.
I'm having the same problem. DIALOGS MESSAGE OFF / ON and DIALOGS ERROR OFF / ON do not work when used in a macro. They do work if typed in the command window though. Any update on when this will be fixed? I've updated to SP3 and still have the issue.
When a macro starts the state of the warning, message, and graphic lock is recorded. When the macro ends the previous state is restored. This is so an early return from the macro or a macro error that cause the macro to end unexpectedly does not leave powermill in a state where the graphics, or messages do not appear to be working. A special case is if you set these values in one of the start up macros (pmlocal, pmuser) where the restoration is not performed.
The behaviour is as designed.
Note you can put the commands into a FUNCTION:
FUNCTION DialogsON() { DIALOGS MESSAGE ON DIALOGS ERROR ON } FUNCTION DialogsOFF() { DIALOGS MESSAGE OFF DIALOGS ERROR OFF }
put these into your file of useful functions "MyFunctions.inc" and include them other macros you write:
FUNCTION Main() { // Don't want dialogs at the moment CALL DialogsOFF() // Do a lot of stuff // Now want the dialogs to display CALL DialogsON() // do a bunch of orher stuff // don't want dialogs anymore CALL DialogsOFF() // a load more stuff } INCLUDE "MyFunctions.inc"
You are correct that the state is locked and that is how it is supposed to work. So, if the state is ON when my macro starts and my macro has the following
DIALOGS MESSAGE OFF
DIALOGS ERROR OFF
Do some stuff
DIALOGS MESSAGE ON
DIALOGS ERROR ON
Then the messages and errors should be OFF during my macro and turned back ON after my macro runs. And if my macro stops in between they will be turned ON because of the previous state. That is how it works in 2016 however in 2017 I get the messages and errors popping up while my macro is running.
Can't find what you're looking for? Ask the community or share your knowledge.