Page 1 of 1

[FIXED] Jump and return does not return on disabled macros

Posted: Wed Jan 02, 2008 12:29 pm
by dexter98
I've noticed that the 'Jump to.... and return' action does not return when it calls disabled macros. I would expect that execution continues or that another option is added like 'continue if disabled'.

Re: Jump to.... and return does not return on disabled macros

Posted: Sat Feb 23, 2008 1:36 am
by dexter98
Anyone? Or is there any other way to 'call' commonly used routines?

I'm now using Trigger Event to 'call' commonly used routines, but this makes it a bit difficult to determine in what order the commands are executed, since the newly triggered events are executed AFTER the current commands are done. For some of my macros, execution order is important.

A 'call' would be nicer, but the current function does not return on disabled macros.

I've been looking into this, but it seems that handling events is quite embedded in the framework.

Re: Jump to.... and return does not return on disabled macros

Posted: Wed Feb 27, 2008 6:03 pm
by Bitmonster
Confirmed. I will look at it, if I have some time.

Re: [OPEN] Jump to and return does not return on disabled macros

Posted: Sat Mar 08, 2008 4:01 pm
by Bitmonster
I currently can't reproduce the error. Might be possible I fixed it sometime and doesn't remember it now. Please grab the latest beta, test it out and report your findings. If you find the bug again, please post an example here.

Re: [OPEN] Jump to and return does not return on disabled macros

Posted: Tue Mar 11, 2008 12:24 pm
by dexter98
Hmmm, I also can't reproduce the error now anymore...

The only thing I could find in MacroItem.py is:

Code: Select all

        if self.isEnabled:
            del eg.lastFoundWindows[:]
            if eg.config.logMacros:
                self.Print(self.name)
            if self.shouldSelectOnExecute:
                wx.CallAfter(self.Select)
                
            if self.childs:
                eg.programCounter = (self.childs[0], 0)
            else:
                eg.programCounter = None

So, if not enabled, the programCounter is not changed at all. I think it should be set to None however, if not enabled:

Code: Select all

        else:
            eg.programCounter = None

Since in this code, a None programCounter forces it to jump back to the caller:

Code: Select all

            if self.programCounter is None:
                # we have no next item in this level. So look in the return 
                # stack if any return has to be executed
                if self.programReturnStack:
                    item, idx = self.programReturnStack.pop()
                    self.programCounter = item.parent.GetNextChild(idx)

Re: [OPEN] Jump to and return does not return on disabled macros

Posted: Tue Mar 11, 2008 1:03 pm
by Bitmonster
EDIT: Posted bullshit. :)

Yes, so it looks like the code should run correctly (since a macro has never a macro as parent and isinstance(item.parent, eg.MacroItem) will return False every time).

So I set this bug to FIXED currently, till we see it again.

Re: [FIXED] Jump and return does not return on disabled macros

Posted: Mon Jun 02, 2008 1:12 am
by jsonnabend
I think I'm still seeing this bug. I have a JumpTo set to always for debug purposes (the jumped-to routine displays some debug text on screen). If I enable the target of the jump and then later disable it, the macro containing the jump action dies at that action. Maybe that's not the same bug, but related perhaps?

Please let me know if there's any additional information that I can provide that might be helpful.

- Jeff

Re: [FIXED] Jump and return does not return on disabled macros

Posted: Mon Jun 23, 2008 6:51 pm
by Bitmonster
Can't reproduce it here.