Page 1 of 1

macro mistakenly clears function window

Posted: Wed Mar 14, 2007 7:55 pm
by JackR
Hi Jussij

I am using version 3.95z. If I have a function window open ( created by pressing the tool bar icon {} ), and then I press the home key in ANY window, the function window is cleared of everything except the copyright header added by Zeus. My home key is mapped to the following macro.

Thanks,
Jack



function key_macro()
screen_update_disable()
local cursor_after_move = 1
local start_cursor = get_cursor_pos()

if ( start_cursor ~= 1) then
MoveLineHome()
MoveWordNext()
cursor_after_move = get_cursor_pos()
end

if (start_cursor == cursor_after_move or start_cursor == 1) then
MoveDocumentStartEx()
end
screen_update_enable()
screen_update()
end

key_macro() -- run the macro

FYI, the goal of this macro is for the 1st time home is press, move the cursor to the 1st character on the line. 2nd press, 1st column, then top of page, last home, top of document.

Posted: Wed Mar 14, 2007 10:09 pm
by jussij
Hi Jack,
I am using version 3.95z. If I have a function window open ( created by pressing the tool bar icon {} ), and then I press the home key in ANY window, the function window is cleared of everything except the copyright header added by Zeus.
Unfortunately I could not replicate this bug :(

What I did to test for the bug was as follows:

(1) I started the Zeus for Windows Programmers Editor - Version 3.95z.

(2) I took your macro and bound it to the Home key:

Code: Select all

function key_macro()
    screen_update_disable()
    local cursor_after_move = 1
    local start_cursor = get_cursor_pos()

    if ( start_cursor ~= 1) then
        MoveLineHome()
        MoveWordNext()
        cursor_after_move = get_cursor_pos()
    end

    if (start_cursor == cursor_after_move or start_cursor == 1) then
        MoveDocumentStartEx()
    end

    screen_update_enable()
    screen_update()
end

key_macro()
(2) I then ran the Function List for the macro itself and I pressed the Home key several times for both windows.

For me all I get is the expected result of the macro moving the cursor with no change at all to the contents of the function list.

(3) I repeated the test for other files with exactly the same results :?

If you try these exact same steps, do you still see the problem :?:

Cheers Jussi

Posted: Thu Mar 15, 2007 12:46 pm
by JackR
Hi Jussi,

This occurs every time UNTIL I exited and re-started Zeus. Now all is good. Sorry, I should have thought of that before I wrote you. Interestingly, File->Exit didn't work either but the Clsoe button to the right of the title bar did.

Jack

Posted: Thu Mar 15, 2007 1:22 pm
by jussij
Hi Jack,

I don't quite understand your reply :?

If you perform the steps I outlined earlier, do you see the clearing of the function list or does the function list behave as expected :?:

If you do continually see this function list error, what steps do you perform to make the problem occur :?:

As I mentioned earlier, while using the 3.95z version I was not able to replicate the error :(

Cheers Jussi

Posted: Thu Mar 15, 2007 9:15 pm
by JackR
Hi Jussij,

Sorry my answer wasn't clear, I'll try again.

If I follow the steps you listed, the problem will occur everytime, extremely repeatable. Every press of the home key clears the function window.

HOWEVER, I then exited Zeus and re-invoked it and now the problem never occurs. Somehow, Zeus got corrupted. Now it's working fine. Zeus was running for a couple days. I've editted many files switching through numerous workspaces. I can't say how to re-create the state I got Zeus in.

Hopefully, this is more clear

Jack

Posted: Thu Mar 15, 2007 10:15 pm
by jussij
Hi Jack,

Ok, that makes more sense now. Thanks ;)
HOWEVER, I then exited Zeus and re-invoked it and now the problem never occurs.
As you suggest, I agree this was most likely cause by some sort of memory corruption. It might be quite difficult to track down since the corruption could have been caused by anything that happened to Zeus over the last few days since the last time it was started :?

Cheers Jussi