Page 1 of 1
A few quick questions
Posted: Sat Jan 22, 2005 5:00 am
by DanNeufeldt
First, I'd like to say that the Zeus editor seems really great. The thing that mainly atracts me to it is the fact that I can use Ruby as a macro language, which is something I've been wanting for some time. Unfortunately there's a few behavioral issues that although small, could discourage me from using it.
The main one is that if I have the cursor at EOL and I use the down arrow to move it to the next line, if the next line is shorter the cursor doesn't snap to EOL but stays in the same position. This could really hamper my general workflow, I can use the End key, but that's not as fast as just hitting down arrow and typing. Also, ctrl+leftArrow will hop there which is a little better but still....
Another one is that ctrl+backspace won't keep going once it's deleted everything on the current line. Is there an option to turn on that will make it jump up to the next line and keep on going? The behavior would be the same as ctrl+leftArror only deleting.
Thanks,
.dan
Posted: Sat Jan 22, 2005 7:26 am
by jussij
The main one is that if I have the cursor at EOL and I use the down arrow to move it to the next line, if the next line is shorter the cursor doesn't snap to EOL but stays in the same position.
To fix this just bind the following Lua macro to the down arrow:
Code: Select all
function key_macro()
screen_update_disable()
-- move down the line
MoveLineDown()
-- get the length of the current line
local length = string.len(get_line_text())
-- get the current cursor position
local cursor = get_cursor_pos()
-- see if the cursor needs to move
if (cursor > length) then
-- move to the end of the line
MoveLineEnd()
end
end
key_macro() -- run the macro
For more information on how to bind macros see the
Binding a Macro to the Keyboard topic. Also if you
replace
MoveLineDown with
MoveLineUp then you will have the
up arrow version of the macro.
I will leave the task of converting this Lua macro into a Ruby macro as an exercise
Another one is that ctrl+backspace won't keep going once it's deleted everything on the current line.
A macro something like this should do the trick:
Code: Select all
function key_macro()
screen_update_disable()
-- get the current cursor position
local cursor = get_cursor_pos()
if (cursor == 1) then
-- move to the end of the previous line
MoveLineUpAndLast()
end
-- delete the previous word
WordDeletePrevious()
end
key_macro() -- run the macro
Cheers Jussi
Posted: Sat Jan 22, 2005 9:29 am
by Guest
Thanks, I was thinking of writing a macro for that, but I was worried about execution speed. ie. does Zeus start up the interpreter each time the macro is run, or does it keep it running in the background.
Thanks for the quick response, with such great support I think I'll probably buy this software.
Posted: Sun Jan 23, 2005 1:49 am
by jussij
Thanks, I was thinking of writing a macro for that, but I was worried about execution speed.
The modern day computer is so fast and these scripts so small, you will not even notice the key is bound to a macro
ie. does Zeus start up the interpreter each time the macro is run, or does it keep it running in the background.
Zeus creates the new interpreter each time. Also the interpreter must re-compile the script each time it is executed. For a single macro I find the execution time is not noticable, but you will notice the slower scripting speed if you need to run the macro a repeated number of times
Even so, the repeated macro speed is still many times faster than what I can type
To get a feel for what I mean you can test this for yourself by creating a simple macro as follows:
- Macros, Record Start/Stop menu
- File, New menu
- Type in "This is my first macro....."
- Hit the enter key
- Macros, Record Start/Stop
Now you can run this macro using
Macros, Playback menu or you can run the macro repeatedly using the
Macros, Repeated Playback menu.
Thanks for the quick response
It is my pleasure
with such great support I think I'll probably buy this software.
I appreciate the gesture

But as I always say, Zeus is shareware and runs fully functional over a long trial period. I strongly recommend using this time to fully evaluate the software, just so you now exact what Zeus can and can not do. Also, all questions regarding Zeus are treated equally, be they regarding the registered or shareware versions.
Cheers Jussi
Posted: Sun Jan 23, 2005 7:06 am
by DanNeufeldt
Thanks again. Seriously though, I am really starting to like this software. (And I've only been using it for a day). Anything that's customizable through scripting, especially with Ruby really draws me to it.
I had to make some modifications to those macros you posted, for some reason the command to disable screen updating was causing the cursor to not go to the proper position. I just know that I removed that line and the cursor then behaved as I wanted.
Also, the ctrl+backspace functionality I ended up liking was
Code: Select all
function key_macro()
-- get the current cursor position
local cursor = get_cursor_pos()
if (cursor <= 1) then
-- move to the end of previous line
BackspaceEx()
else
MoveWordPrevious()
WordDeleteNext()
end
end
key_macro() -- run the macro
And that's what strikes me as so cool with this program, there are so many commands for everything you do in it. I had no idea it was that customizable.
There is currently only one thing bothering me and it's that when I select some text I can't drag it. Clicking the mouse to drag it just de-selects. Is this an option I haven't found yet or is that just the way it is?
Posted: Sun Jan 23, 2005 1:04 pm
by jussij
for some reason the command to disable screen updating was causing the cursor to not go to the proper position.
That is my mistake
As the name suggest the
screen_update_disable disables all screen updates. What is missing from the original macro are the following lines of code:
Code: Select all
-- restore screen updates
screen_update_enable()
-- force a screen update
screen_update()
For small macros these functions are not really needed, but for macros that cause a lot of text changes or do a lot of cursor movement, these function can help speed up the macro, as they stop unneeded screen updates.
Code: Select all
Also, the ctrl+backspace functionality I ended up liking was
That is the great thing about the scripting. It is possible to configure the editor to work exactly to your liking
There is currently only one thing bothering me and it's that when I select some text I can't drag it. Clicking the mouse to drag it just de-selects. Is this an option I haven't found yet or is that just the way it is?
You have now found something that Zeus does not do well
You may have already notice that Zeus is a keyboard centric editor. This fact even shows on the menus and dialog boxes, which are all accelerator key enabled (ie you can use the Alt + the underscore character to move the focus in dialogs etc).
The reason for this is simple. Zeus was originally modelled on the MS-DOS Brief editor and back to those days the mouse did not even exist
Thus Zeus has grown up without a lot of the mouse editing features found in todays editors and unfortunately trying to convert this keyboard driven editor engine into a mouse driven editor engine is not always an easy task
Cheers Jussi
Posted: Mon Jan 24, 2005 7:22 am
by DanNeufeldt
Ok, now I have a new thing.
I'm still not quite happy with the ctrl-backspace functionality, so I decided to switch to Ruby so I can do some actual scripting rather than just calling Zeus functions, because I think I need to do some text-processing of my own to really get what I want.
Well, when I try to run the macro I get this error:
Error creating 'RubyScript' scripting module.
Reason: Invalid class string
Just to be sure I tried running your example.rbs macro, and I still get the error. I've set the active scripting module to ruby, is there something else I need to do?
Thanks.
Posted: Mon Jan 24, 2005 10:34 am
by jussij
This macro scripting error:
Code: Select all
Error creating 'RubyScript' scripting module.
Reason: Invalid class string
means the RubyScript is not installed.
The Ruby Script used in Zeus is not the stock standard Ruby. Zeus uses the Ruby Script Windows Scripting Host (WSH) version. This is the scripting engine that Internet Explorer would use if you embedded Ruby Script into a web page.
I found out about the Ruby Script WSH implementation from this link:
In theory Zeus can handle any of the scripting languages listed on this page, but the Ruby Script was the only one tested.
I did a search for the Ruby Script WSH and it looks like it can be found here:
After you install the Ruby Script things should start to work fine: )
For example I created this simple Zeus Ruby macro:
Code: Select all
def key_macro()
@zeus.screen_update_disable();
@zeus.FileNew();
@zeus.screen_update_enable();
@zeus.screen_update();
end
key_macro() # run the macro
which will runs fine and generates the following debug output:
Code: Select all
--------------------------------------------------------------------
Zeus for Windows Programmers Editor - Version 3.94
Copyright (c) Xidicone Pty Ltd 1993-2005. All rights reserved.
--------------------------------------------------------------------
**** NOTE: DEBUG OUTPUT ENABLED ****
This and other debug output text is being displayed because the Zeus
debug output option is currently enabled. To disable this debug output
just select the Options, Editor Options menu and in the General Options
section un-check the 'Help debug, tools, macros and executables' option.
About to execute 'c:\temp\test.rbs' macro file
Debug: Initialising macro interface
Debug: The Zeus object was requested and returned.
Debug: GetIDsOfNames call succeeded.
Debug: screen_update_disable
Debug: GetTypeInfo call succeeded.
Debug: GetIDsOfNames call succeeded.
Debug: FileNew
Debug: GetTypeInfo call succeeded.
Debug: GetIDsOfNames call succeeded.
Debug: screen_update_enable
Debug: GetTypeInfo call succeeded.
Debug: GetIDsOfNames call succeeded.
Debug: screen_update
Debug: GetTypeInfo call succeeded.
Debug: Script object destroyed.
Debug: Destroying macro interface
Macro produced '17' Warning(s), Error(s) and/or Debug(s) messages.
Cheers Jussi
Posted: Thu Jan 27, 2005 8:49 am
by Guest
cool, I'm going to try to install that version tomorrow when someone can log in as admin on my computer (I'm at work so I can't) I'll try it on my home computer and see how it works out.
I've been using Zeus quite a bit and am really liking it. Once I can script it I think things will just get better.
Posted: Thu Jan 27, 2005 8:50 am
by Guest
I meant to say, once I can script it with Ruby. It's already pretty scriptable. And I've been using Lua for minor macros.
Posted: Thu Jan 27, 2005 10:53 am
by jussij
The Zeus Ruby scripting is one of the more recent addition and as such has not been tested quite as thoroughly as the others.
I suspect it should work fine but if you do run into problems just post a bug report and the offending script to the bugs section of the forum.
Cheers Jussi