Zeus VbScript and Variables
Posted: Mon Jun 25, 2007 11:51 pm
This very simple VbScript macro will display display the current line and cursor position in the message bar.
It shows how to assign a VbScript local variable to the value return by a Zeus built-in function:
When run. the macro will display the current line and cursor position in the message section of the status bar and these details will match the line and cursor details shown on the right of the status bar.
Cheers Jussi
It shows how to assign a VbScript local variable to the value return by a Zeus built-in function:
Code: Select all
Function key_macro()
' must have a document window
if zeus.is_document() = 0 then Exit Function
' get current line position using the tag
tag_line_num = zeus.macro_tag("$Line")
' get current line position
line_num = zeus.get_line_pos()
' get current cursor position
cursor_pos = zeus.get_cursor_pos()
' build up a message
message = "Tag Line: " & tag_line_num & " Line: " & line_num & " Cursor: " & cursor_pos
' display message in status bar
call zeus.message(message)
End Function
key_macro() 'run the macro
Cheers Jussi