Hi,
I have the following lines in an extract of verilog code:
/////////////////
in1,
in2,
in3,
in4,
out
/////////////////
which I'm attempting to transform (using a multiple playbacks of recorded keystroke macro) into the following:
/////////////////
.in1(in1),
.in2(in2),
.in3(in3),
.in4(in4),
.out(out)
/////////////////
The macro I have recorded, to attempt to do this, is as follows:
function key_macro()
screen_update_disable()
MoveLineHome()
print(".")
MarkBlockSet()
MoveWordNext()
MarkBlockReset()
MarkCopyEx()
print("(")
MarkPasteEx()
print(")")
MoveLineDown()
screen_update_enable()
screen_update()
end
key_macro() -- run the macro
However, what I'm actually getting is:
/////////////////
.in1(in1),
.in2(),
.in3(),
.in4(),
.out()
/////////////////
I've tried changing the Ctrl+V keyboard shortcut from MarkPasteEx to MarkPasteSmart to MarkPaste, with differing results. However, none of these seem to give the desired result. I'd appreciate any insight on this.
Regards,
Ciaran.
Problem running macro
This is very strange 
When I run your macro:Using you input text text:
I get your expected result:
Which version of Zeus are you running 
I supect the problem might lie here:If the MoveWordNext does not move the cursor then nothing will get copied to the clipboard and hence nothing will get written by the MarkPasteEx function that follows.
One thing to remember is the MoveWordNext function defines word breaks using the delimiters defined in the document type, which could explain why I am not seeing the issue
To test this theory see if the macro works in a plain text (.txt) file.
One thing you could try is changing the order in which theings are done when the macro is recorded.
For example, rather than doing line home, print '.', mark copy, ... could you try line home, markcopy, line home, print '.', word next, paste... and see what that does?
Using this approach the following macro would have been recorded:Using you input text text:
Using you input text text:
[/code]
But what is really strange is your macro runs fine for me
Cheers Jussi

When I run your macro:
Code: Select all
function key_macro()
screen_update_disable()
MoveLineHome()
print(".")
MarkBlockSet()
MoveWordNext()
MarkBlockReset()
MarkCopyEx()
print("(")
MarkPasteEx()
print(")")
MoveLineDown()
screen_update_enable()
screen_update()
end
key_macro() -- run the macro
Code: Select all
/////////////////
in1,
in2,
in3,
in4,
out
/////////////////
Code: Select all
/////////////////
.in1(in1),
.in2(in2),
.in3(in3),
.in4(in4),
.out(out)
/////////////////

I supect the problem might lie here:
Code: Select all
MarkBlockSet()
MoveWordNext()
MarkBlockReset()
One thing to remember is the MoveWordNext function defines word breaks using the delimiters defined in the document type, which could explain why I am not seeing the issue

To test this theory see if the macro works in a plain text (.txt) file.
One thing you could try is changing the order in which theings are done when the macro is recorded.
For example, rather than doing line home, print '.', mark copy, ... could you try line home, markcopy, line home, print '.', word next, paste... and see what that does?
Using this approach the following macro would have been recorded:
Code: Select all
function key_macro()
screen_update_disable()
MoveLineHome()
MarkBlockSet()
MoveWordNext()
MarkBlockReset()
MarkCopyEx()
MoveLineHome()
print(".")
MoveWordNext()
print("(")
MarkPasteEx()
print(")")
MoveLineDown()
screen_update_enable()
screen_update()
end
key_macro() -- run the macro
Code: Select all
One other thing worth trying is binding the [i]MarkWordCurrent[/i] and [i]MoveWordEnd[/i] function to the keyboard key and using this keys as a replacement of the three lines of block marking code.
I have these functions bound to [i]Alt+H[/i] and [i]Alt+Left Arrow[/i] respectively and find these functions are invaluable when recording keyboard macros.
Using this approach the following macro would have been recorded:
[code]function key_macro()
screen_update_disable()
MoveLineHome()
print(".")
MarkWordCurrent()
MarkCopyEx()
MoveWordEnd()
print("(")
MarkPasteEx()
print(")")
MoveLineDown()
screen_update_enable()
screen_update()
end
key_macro() -- run the macro
[/code]
But what is really strange is your macro runs fine for me

Cheers Jussi
Hi Jussi,
Thanks for your prompt reply. I'm using Zeus 3.96s on Windows XP Pro.
When I tried the existing macro in a .txt file, as you suggested, it worked fine. The strange thing is, that when I then tried it in the .v file it worked fine then also
. Now I can't get it to fail at all anymore.
As I had rebooted my machine prior to this, I can't say for definite whether the reason for the change in behavior was due to the reboot and re-launch of Zeus or due to the fact that I tried it in the .txt file, which somehow changed the behavior for other file types.
Thanks for your tips on the keystroke bindings. They look very useful.
Regards,
Ciaran.
Thanks for your prompt reply. I'm using Zeus 3.96s on Windows XP Pro.
When I tried the existing macro in a .txt file, as you suggested, it worked fine. The strange thing is, that when I then tried it in the .v file it worked fine then also

As I had rebooted my machine prior to this, I can't say for definite whether the reason for the change in behavior was due to the reboot and re-launch of Zeus or due to the fact that I tried it in the .txt file, which somehow changed the behavior for other file types.
Thanks for your tips on the keystroke bindings. They look very useful.
Regards,
Ciaran.