Home
    
Home Features Download Support Contact

Using Macros

You can record a macro in WinEdit by choosing Record Macro from the Project menu. Choose Stop Recording when the macro is complete. The macro you record is immediately available for playback, and will not be automatically saved. If you wish to save it, choose Save Recorded Macro from the Project menu, and choose a descriptive name for your new macro. You will then be asked if you wish to add the new macro to the Project menu. If you do, the new macro will appear on the Project menu, and will also be available from the toolbar as a User Tool.

Once your macro is recorded, you can open the macro source in WinEdit and edit it. Macro recording is great for simple quick jobs; typing some short text, moving around a document, repetitively editing a line. But if you want to take full advantage of the powerful WIL macro language, you will need to write some code. You can use all the facilities of a modern language, including control loops, variables, user input, and more. Check the Help file for a detailed reference to WinEdit’s macro language, including a tutorial.

 

Debugging A Macro

You can use WinEdit’s macro debugger to refine and perfect your macros. The most basic use is to "step" through the macro code. Choose Step Into from the Project.Debug Macro to execute the macro one line at a time. As each line is executed the current state of all variables is displayed in a special watch window.

Breakpoints can be used where there is a large quantity of code and you are interested in debugging a specific section of it. To use breakpoints, click on a line of code and click the Insert/Remove Breakpoint button on the toolbar. A red square will appear next to the line, indicating a breakpoint is active on the line. When you click the Go button, the script will start executing and will stop when it hits the line with a breakpoint. You may have several different lines with breakpoints.

The Watch Window allows you to view the contents of script variables. From the View Menu select the Watch menu option to display the Watch Window. To change a value, double-click on the variable name in the Watch Window, type a new value and click the OK button in the dialog that appears.



Back to Support Main Page


WinEdit - Java, HTML, Programming Editor Java, HTML, and Text Editor - WinEdit Java, HTML, and Text Editor - WinEdit
Copyright © 1990-2001 WinEdit Software Co. All Rights Reserved.