Macro-Recording Error

If reporting a bug with the Zeus editor please post the details here. Please do not post questions here.
amix
Posts: 49
Joined: Wed Aug 22, 2007 1:26 pm

Macro-Recording Error

Postby amix » Wed Oct 03, 2007 12:55 am

The macro I am trying to record creates following line:

Code: Select all

<include name="XYZ/**" id="XYZ" />
from XYZ, which is the first and only word in the row.

Code: Select all

Scripting Error :>  File: E:\zfw\zScript\Macro0.js (5:23) >>    zeus.MoveDocumentEndEx
Reason: '}' erwartet

Error parsing 'E:\zfw\zScript\Macro0.js' macro script.Macro script generated '2' Debug, Error and/or Warning message(s).


My default scripting-engine is JScript. If I do it with LUA as default it works flawlessly.

jussij
Site Admin
Posts: 2228
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Wed Oct 03, 2007 2:05 am

Hi Amix,

Can you post the macro script that creates this error message :?:

When I record a macro to create this text it works fine for me :?

Here is the macro I recorded:

Code: Select all

function key_macro()
{
    zeus.screen_update_disable
    zeus.write("<include name=\"XYZ/**\" id=\"XYZ\" />\n")
    zeus.screen_update_enable
    zeus.screen_update
}

key_macro()   // run the macro

Cheers Jussi

amix
Posts: 49
Joined: Wed Aug 22, 2007 1:26 pm

Postby amix » Wed Oct 03, 2007 2:43 am

This is yesterday's macro (the one I reported):

Code: Select all

function key_macro()
{
   zeus.screen_update_disable
   zeus.write("<include name=\"")
   zeus.MoveDocumentEndEx   
   zeus.write("/**\"")
   zeus.MarkBlockSet   
   zeus.MoveWordPrevious   
   zeus.MoveWordPrevious   
   zeus.MoveWordNext   
   zeus.MoveWordNext   
   zeus.MarkBlockReset   
   zeus.none   
   zeus.MarkBlockSet   
   zeus.MoveWordNext   
   zeus.MarkBlockReset   
   zeus.MarkCopyEx   
   zeus.MoveDocumentEndEx   
   zeus.write(" id=\"")
   zeus.MarkPasteEx   
   zeus.BackspaceSmart   
   zeus.write("\" />")
   zeus.MoveLineDown   
   zeus.MoveLineHome   
   zeus.screen_update_enable
   zeus.screen_update
}

key_macro()   // run the macro


It has some more stuff (blurb) in it, since I did a mistake while recording but did not want to re-record.

I then re-recorded it with Lua set as default (and being a bit more intelligent about what I typed). This is it:

Code: Select all

function key_macro()
    screen_update_disable()
    print("<include name=\"")
    MarkBlockSet()
    MoveWordNext()
    MarkBlockReset()
    MarkCopyEx()
    print("\"")
    MoveLineLeftEx()
    print("/**")
    MoveDocumentEndEx()
    print(" id=\"")
    MarkPasteEx()
    print("\" />")
    MoveLineDown()
    MoveLineHome()
    screen_update_enable()
    screen_update()
end

key_macro() -- run the macro


This one worked.

P.S. The JScript file seems to have some binary data in it (but one can easily chose view-as-text-only without garbage in TotalCommander's Viewer.exe)

jussij
Site Admin
Posts: 2228
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Thu Oct 04, 2007 12:22 am

That is very interesting. The macro contains the following Zeus function which is causing the problem:

Code: Select all

zeus.none

I have never seen that before and I'm not even sure how you managed to record it :?:

I suspect it was caused by using the mouse while recording the macro :?

For example using the close document cross (i.e top right corner) while recording a macro will cause a similar sort of macro scripting error.

Cheers Jussi

amix
Posts: 49
Joined: Wed Aug 22, 2007 1:26 pm

Postby amix » Sat Oct 13, 2007 5:22 pm

It just happened again:

Code: Select all

function key_macro()
{
   zeus.screen_update_disable
   zeus.MoveWordNextEx   
   zeus.MoveLineLeftEx   
   zeus.MarkBlockSet   
   zeus.MoveWordNext   
   zeus.MoveWordNext   
   zeus.MarkBlockReset   
   zeus.MarkDeleteEx   
   zeus.write("var ")
   zeus.MoveWordNextEx   
   zeus.write("= ")
   zeus.MoveDocumentEndEx   
   zeus.write(";")
   zeus.MoveLineDown   
   zeus.MoveLineHome   
   zeus.screen_update_enable
   zeus.screen_update
}

key_macro()   // run the macro


It seems it happens each time I record a macro using the jscript scripting engine as default.

Code: Select all

---------------------------------------------------------------------------
     Zeus for Windows Programmers Editor - Version 3.96j
     Copyright (c) Xidicone P/L 1993-2007.  All rights reserved.
---------------------------------------------------------------------------

Scripting Error :>  File: E:\zfw\zScript\Macro0.js (4:20) >>    zeus.MoveWordNextEx
Reason: '}' erwartet

Error parsing 'E:\zfw\zScript\Macro0.js' macro script.Macro script generated '2' Debug, Error and/or Warning message(s).


"erwartet" is german for "expected".

But I see no 'zeus.none' this time. Of course, this is no hassle, since I can easily switch on the LUA interpreter. I just thought you may be interesting in this.

jussij
Site Admin
Posts: 2228
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Sun Oct 14, 2007 11:38 pm

This is very strange. The macro looks just fine.

Of course, this is no hassle, since I can easily switch on the LUA interpreter.

Did this happen after running Zeus constantly for a long while :?:

My hunch is this is some sort of memory leak :?

I did a search of the Web and did come across a few reports suggesting the WSH JScript does leak memory.

Cheers Jussi

amix
Posts: 49
Joined: Wed Aug 22, 2007 1:26 pm

Postby amix » Mon Oct 15, 2007 4:01 pm

jussij wrote:Did this happen after running Zeus constantly for a long while :?:


Could be ;-)
However, it happens each time I use it, so also after rebooting the machine, starting Zeus anew.
I did a search of the Web and did come across a few reports suggesting the WSH JScript does leak memory.

At least it is well known to do so in IExplorer. So this may well be true.

jussij
Site Admin
Posts: 2228
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Mon Oct 15, 2007 11:33 pm

I can't be sure but I have a hunch this bug might be related to the mysterious abort bug :?

http://www.zeusedit.com/forum/viewtopic.php?t=1230

The abort bug definitely caused by some sort of corruption in the memory manager and I'm hoping to have a fix for this shortly.

Cheers Jussi

jussij
Site Admin
Posts: 2228
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Fri Oct 19, 2007 1:19 am

This bug may/may not have been fixed in the latest Zeus patch :?

So any users experiencing this error should first make sure they are running Zeus Version 3.9k or higher which is found here:

http://www.zeusedit.com/forum/viewtopic.php?t=1274

Cheers Jussi

amix
Posts: 49
Joined: Wed Aug 22, 2007 1:26 pm

Postby amix » Fri Oct 19, 2007 2:47 am

Code: Select all

---------------------------------------------------------------------------
     Zeus for Windows Programmers Editor - Version 3.96k
     Copyright (c) Xidicone P/L 1993-2007.  All rights reserved.
---------------------------------------------------------------------------

Scripting Error :>  File: E:\zfw\zScript\Macro0.js (4:20) >>    zeus.MoveWordNextEx
Reason: '}' erwartet

Error parsing 'E:\zfw\zScript\Macro0.js' macro script.Macro script generated '2' Debug, Error and/or Warning message(s).


Code: Select all

function key_macro()
{
   zeus.screen_update_disable
   zeus.MoveWordNextEx   
   zeus.MarkBlockSet   
   zeus.MoveWordPrevious   
   zeus.MoveWordPrevious   
   zeus.MarkBlockReset   
   zeus.MarkDeleteEx   
   zeus.MoveDocumentEndEx   
   zeus.MoveLineDown   
   zeus.MoveLineHome   
   zeus.screen_update_enable
   zeus.screen_update
}

key_macro()   // run the macro


Sorry to disapoint you , still there.

But...

I added ; at each line of the 'Macro0.js'. Then I saved the macro under a different name, loaded it and it worked!

First I had set back the engine to LUA, but I rechecked with the default scripting engine set to JS. In both cases it worked. JS does not require the ; at every place, but maybe you should try to add it ? I also noticed, that there is blanks behind each line, may be, that some invisible binary data got into the way (remember, last time I tried loading the 'Macro0.js' with my file-viewer, I got the hex-display due to binary chars), which got removed by my manual edit now, when I added the semicolon. Not sure, but maybe this helps ?

Code: Select all

function key_macro()
{
   zeus.screen_update_disable;
   zeus.MoveWordNextEx;
   zeus.MarkBlockSet;
   zeus.MoveWordPrevious;
   zeus.MoveWordPrevious;
   zeus.MarkBlockReset;
   zeus.MarkDeleteEx;
   zeus.MoveDocumentEndEx;
   zeus.MoveLineDown;
   zeus.MoveLineHome;
   zeus.screen_update_enable;
   zeus.screen_update;
}

key_macro();   // run the macro

jussij
Site Admin
Posts: 2228
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Fri Oct 19, 2007 3:37 am

I'm a bit confused :?

If I take you broken macro code:

Code: Select all

function key_macro()
{
   zeus.screen_update_disable
   zeus.MoveWordNextEx   
   zeus.MarkBlockSet   
   zeus.MoveWordPrevious   
   zeus.MoveWordPrevious   
   zeus.MarkBlockReset   
   zeus.MarkDeleteEx   
   zeus.MoveDocumentEndEx   
   zeus.MoveLineDown   
   zeus.MoveLineHome   
   zeus.screen_update_enable
   zeus.screen_update
}

key_macro()   // run the macro
and save it to a c:\temp\test.js and the run it via the Macros, Execute Script menu I don't get any errors reported and the macro runs fine :?:

If you do the same do you get the error message :?:

If you do then that should be easy enough to fix, since it just means Zeus is writing JScript that is not syntactically valid (i.e. getting Zeus to add in these semi colons is very easy todo).

Cheers Jussi

amix
Posts: 49
Joined: Wed Aug 22, 2007 1:26 pm

Postby amix » Fri Oct 19, 2007 10:32 am

Okay, I have played around a little. Here are the steps to reproduce:
    Set default scripting engine to jscript.
    Create new text-file, paste some text into it.
    Record a macro.
    Run it via F8. <- Boom! Macro breaks.
The last macro I recorded, which definitley breaks on my system is attached. I have zipped it. That means, it should be preserved as it is on my filesystem. The interesting thing (and the reason I zipped it), is, that it seems to contain binary-characters. It think so, because when I open it with the viewer utility of my file-manager it gets displayed in the hex-mode. That was the case the last time, too. It is not, however, the case with LUA macros (and those don't break). Since I am just a scripting, and you are a (very dynamic) hardcode guy (aka binary wizard), I hope you know how to discover it. :D I only believe what I see, lol. :wink:

P.S. Can't attach files to the forum so I'll send it as email.
P.P.S. We're going to get that little bastard and slap it into its face!

jussij
Site Admin
Posts: 2228
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Sat Oct 20, 2007 12:44 am

Hi amix,

You where spot on about the binary data ;)

Due to a small bug in the Zeus WSH scripting engine code, macros where getting recorded with unwanted binary information.

Luckily it should be easy enough to fix. I'll have a fix for this shortly :)

Cheers Jussi

jussij
Site Admin
Posts: 2228
Joined: Fri Aug 13, 2004 5:10 pm

Postby jussij » Sat Oct 20, 2007 3:04 am

This bug should now be fixed :)

I have updated the lastest Zeus patch with this fix. To fix this bug just re-apply the patch from this link:

http://www.zeusedit.com/forum/viewtopic.php?t=1274

NOTE: The version of Zeus shown in the about dialog should read: 3.96ka

Cheers Jussi

amix
Posts: 49
Joined: Wed Aug 22, 2007 1:26 pm

Postby amix » Sun Oct 21, 2007 8:42 pm

Right on ! :)

Installed 3.96ka and now it works. Congrats!

Thanks.


Return to “Reporting a Bug”

Who is online

Users browsing this forum: No registered users and 1 guest

cron