WinPTE.com

 

Useful Macros

This section includes instructions and listings of some useful macros you may want to either add to your installation or for occasional use to run once in a while you can just copy them into a file (anywhere you want. WinPTE installation directory is a good place) and run them when you need them.

I have started detailing the WinPTE macro language with lots of apologies for some of its cryptic nature and limitations. But in the end until it is replaced with something else (most likely python 2.4), WinPTE macros are about the only way to add functionality to WinPTE. Perl is also available and fully functional. I started documenting the interface with WinPTE but since perl is not everyone's cup of tea, WinPTE macros are still the way to go for most people.

FYI: if you add any commands or macro definitions to the custom.pte file (In the WinPTE installation directory, you will need to create a new file since it is not part of the installation) then these commands and macros will be part of WinPTE's startup initialization. So add the text for any macros you find here to your custom.pte to make them part of your standard configuration.

Macro

Programming Language

Description
Included in Build #
Last Updated
ALL
Adds incremental search capability to WinPTE. Typed characters are accumulated as the search pattern and the cursor moves to the next/previous occurrence of the found pattern in the file. (Enhanced version part of Release 3.00.445)
3.00.445
March 6, 2005
ALL
Adds a user defined command called 'run' that lets you run a script or a console application and captures its output to a text file.
-
March 10, 2005
ALL
Adds a user defined command called 'timeit' that executes an arbitrary WinPTE command and shows elapsed execution time in ms. Combined with the Run command will let you do rough timing and capture of output of scripts (not necessarily WinPTE scripts but any that you can run from the command processor).
-
March 10, 2005
ProvideX
Finds missing closing brace in files given in a list. Creates a list of files that are missing a closing brace } and the location of the opening brace that has no matching close brace. Use this check your existing source files for the missing brace error.
-
March 7, 2005

 

Quick Review:

Displaying the WinPTE key name for any key that is definable in WinPTE

Until the GUI version of key assignments is complete you can use the following to quickly tell what the WinPTE name of the key with the alt, ctrl and shift decorations:

A much better alternative for getting the key name is to place the cursor where you want the key name inserted in the file and execute the following command on the command line:

ex [key name][clear next key] 

You will be prompted to 'Type a character', the WinPTE name of the key you hit (with all the Alt, Ctrl and Shift modifiers) will be inserted at the current cursor location in the file. If you hit a key combination and the message is still displayed and nothing happens then this key combination is not definable in WinPTE (it does not see it). You can always interrupt the macro by hitting Ctrl+Break. At most one more function will be executed before the break request is honored.

The above is assigned to the Alt+0 key and you can simply hit Alt+0 and the next key will be inserted at the cursor position.

If you want to know:

 

 

Site Map | Privacy Policy | Contact Us | ©2004 Winpte.com