Jump to content
Macro Express Forums

BUG: "Macro enable" command is unreliable [still in 4.2.1.1]...


Recommended Posts

I made a macro that toggles between disabling/enabling many macros in a sequence [like a batch]. But some of the macros that appear as enabled in the Macro Explorer don't actually work. I have to use the interface to manually disable and reenable one of those macros to fix the the rest that aren't working. Can this be fixed?

 

BTW: This problem mostly affects macros that are later in the sequence. And affects a different amount of macros each time.

 

ALSO: The macro disable command works much faster than macro enable command. I noticed this when running a macro that enable/disable multiple macros at once. Can the macro enable command be improved to be faster?

 

Perhaps this whole problem can be worked around by adding this feature...

 

Macro command to disable/enable a whole category of macros?

http://pgmacros.invisionzone.com/index.php?showtopic=4520

Link to comment
Share on other sites

I made a macro that toggles between disabling/enabling many macros in a sequence [like a batch]. But some of the macros that appear as enabled in the Macro Explorer don't actually work. I have to use the interface to manually disable and reenable one of those macros to fix the the rest that aren't working. Can this be fixed?

 

BTW: This problem mostly affects macros that are later in the sequence. And affects a different amount of macros each time.

 

If you upload the MEX file, and add detailed instructions for running it, I'll try to reproduce the problem.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

since mine is linked to a bunch of different macros, it may be kind of bulky to upload a bunch of macros. so here is a quick way to make something similar to my setup.

 

- make a category for notepad

 

- make 16 macros--each one activated by pressing each button on the keypad [except numlock]. make each keypad macro beep when pressed.

 

- disable the whole category

 

- make a new macro for enabling all 16 keypad macros when F12 is pressed

 

- press F12 to enable the keypad macros. wait until they're all enabled. [MEPro is rather slow at this--slower than ME3.]

 

- test the reenabled keypad macros and see if they all beep. this is when the bug happens. not all will be working--even though it shows as enabled in the macro explorer list.

Link to comment
Share on other sites

a workaround i'm using for this bug is by duplicating my whole section of "macro enable" commands with a delay of 100ms in between the two sections. this prevents the bug most of the time. works even better if i triplicate them. but the problem with this workaround is that each duplicate makes the macro run even slower than it is.

 

BTW: i hope the MEPro macro enable/disable commands can be made to run faster, like in ME3. i know those commands run faster with the macro explorer closed but, even then, ME3 is still noticeably faster than MEPro at this. this is also why it would be helpful to have a category enable/disable command.

Link to comment
Share on other sites

I do not believe the en/disable command was intended as a commonly used 'run time' command but more a maintenance and special purpose kind of deal. For instance I have a macro that 'rolls out' my development copy and in the macro are several I do not want to run while I'm working on it so the roll out macro enables and disables several macros. But it's a one time thing, not something that is commonly used in my macros. I think you should consider using a different method to do whatever it is you're trying to do. IE I think you're trying to drive a screw with a hammer.

Link to comment
Share on other sites

I do not believe the en/disable command was intended as a commonly used 'run time' command but more a maintenance and special purpose kind of deal. For instance I have a macro that 'rolls out' my development copy and in the macro are several I do not want to run while I'm working on it so the roll out macro enables and disables several macros. But it's a one time thing, not something that is commonly used in my macros. I think you should consider using a different method to do whatever it is you're trying to do. IE I think you're trying to drive a screw with a hammer.

 

this problem may not bother you. but for what i'm trying to make it do, it is a problem. it is only a problem for me since upgrading to MEPro, was fine on ME3. there is no workaround for this unless MEPro gets a category enable/disable command--which would be more efficient. currently it looks like a bug and performance issue of MEPro.

Link to comment
Share on other sites

Yeah it sounds like a design defect in your macros. Because ME3 couldn't run multiples you didn't have a problem. I highly suggest you rethink your logic here and come up with a better solution. I would offer advice but you rarely disclose exactly what your macros do.

Link to comment
Share on other sites

its not a design defect in my macros because the same thing has been tested to run much faster in ME3 compared to MEPro.

 

i just have many macro enable commands in a single macro. like this...

 

Macro Enable: Macro 1

Macro Enable: Macro 2

Macro Enable: Macro 3

Macro Enable: Macro 4

Macro Enable: Macro 5

Macro Enable: Macro 6

Macro Enable: Macro 7

Macro Enable: Macro 8

Macro Enable: Macro 9

...

 

but the more i have the slower the macro runs. so its a MEPro performance issue. and there is also a bug to go with it.

Link to comment
Share on other sites

  • 2 months later...

I'm looking into whether or not I can speed this up. I'm actually surprised to find that the disable works faster than the enable because they're actually the same block of code executing. Specifically, the code looks like this:

if( (macro.currentCommand() = scEnableMacro) and (mac^.flags and mEnabled = 0) )then
 mac^.flags := mac^.flags or mEnabled
else if( (macro.currentCommand() = scDisableMacro) and (mac^.flags and mEnabled <> 0) )then
 mac^.flags := mac^.flags and (not mEnabled);

 

The speed problem may be related to some synchronization code we have to keep the macro threads from interfering with each other (we need to use that in this area to keep multiple macros from writing to the macro file simultaneously). This is something we didn't need to do in ME3 because of the lack of simultaneous macros. It is a potential slowdown.

 

Another possible cause of the speed problems could be that we have to reload the menus. We did this in ME3, but again, we have to synchronize the file access.

 

One question, though: are the macros contained in the same file that contains the macro that is enabling/disabling them? Or, do they exist in a separate macro file? If they are in a separate file, that would definitely account for the speed difference as MEPro would have to open the file, enable/disable the macro and then close the file. But, if the file was already open in the explorer, that operation wouldn't be executed.

 

I'll take a look at this today.

Link to comment
Share on other sites

  • 3 weeks later...

curious:

i have previously submitted a feature request for a macro command to disable/enable a whole category of macros. so that a category can be disable/enable instead of each macro one by one. if such a feature is implemented, do you think it will workaround this slowness problem? or do you think it will still be as slow unless this bug is fixed?

Link to comment
Share on other sites

i just upgraded to 4.2.1.1 but still have the same problem with the "macro enable" commands being unreliable when enabling many macros at once. i have a macro that uses many "macro enable" commands sequentially to toggle enable/disable many macros at once. and because of the bug, i currently still have to triplicate the "macro enable" commands in the macro to make them work reliably. consequently, this means my macro will run 3x slower when using it to enable. can this be fixed in the next version?

 

btw: i've tried duplicating instead of triplicating, but triplicating is more reliable--which should point out how bad the bug is.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

is there a way to workaround this problem? perhaps by putting that category of macros into a separate .mex file? but is there a way to make a macro that checks if that .mex file is opened or not, and then toggle the opening and closing of that .mex file?

 

i already tried...

 

- using many consecutive "macro enable" commands at once, but that runs into a bug

- triplicating the "macro enable" commands to compensate for the bug, but then that runs extremely slow

- a probable solution is to use a macro command that can enable/disable a whole category at once to bypass the above 2 problems, but such a macro command doesn't exist

 

what else can i do to make this work?

 

BTW: this is the only major bug that annoys me since the upgrade from ME3 to ME4. ME3 didn't have this issue and handled this function quick and flawlessly. why can't it work the same way in ME4?

Link to comment
Share on other sites

Macro Express Pro supports macros in multiple files. The macro and file handling is more complicated than that of Macro Express 3 and thus, it may take longer to process Macro Enable and Macro Disable commands.

 

We recently made some changes to the routines that handle enabling and disabling macros. In our testing based on your description of the problem, the changes we made improved enabling and disabling macros.

 

We have made two suggestions:

 

1. Put a small delay between each Macro Enable or Macro Disable command.

 

2. Put your macros in separate files. You can load and unload separate macro files containing macros using the Load New Macro File and

Close Macro File commands.

 

If you need further help with this issue then contact our Support people. Be prepared to give them your license number or other proof of purchase.

Link to comment
Share on other sites

We recently made some changes to the routines that handle enabling and disabling macros. In our testing based on your description of the problem, the changes we made improved enabling and disabling macros.

is that improved in an upcoming version? if you're talking about 4.2.1.1, it made no improvement for this problem.

 

1. Put a small delay between each Macro Enable or Macro Disable command.

but this will still slow down the macro and add to the waiting time--especially with lots of consecutive macro enable commands

 

2. Put your macros in separate files. You can load and unload separate macro files containing macros using the Load New Macro File and

Close Macro File commands.

but there are no "if macro file open" or "if not macro file open" logic commands. so i can't make a single macro hotkey that toggles the opening and closing of the macro files based on those conditions. is there some way to make this work, or can such commands be added in a future version?

Link to comment
Share on other sites

i guess i'll be saving the support people the hassle because i finally figured out a workaround! i moved that group of macros into a separate macro file called filename.mex. one of the macros in that group is called X. i managed to make a toggle to load/close filename.mex by simply enable/disable one of the macros--in this case X. the macro goes like this...

 

if macro X is disabled

macro enable X in filename.mex

else

if macro X is enabled

macro disable X in filename.mex

close macro filename.mex

end if

end if

 

hope this helps anyone else with a similar problem.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...