I use syntax highlighting for viewing Leica gsi format data text files.
The vedit installation default method of using highlighting is via the
startup.vdm. The user specified file types(ie extensions) are always opened
with highlighting switched on. Highlighting can of course be turned off.
Files with different extensions will be auto highlighted.
I don't always wish to have the highlighting switched on. I prefer to have a
function key dedicated to load the syn file and switch on/of highlighting
whenever I wish on ANY file open.
The next paragraph is the vedit macro to toggle gre syntax highlighting on
and off. Each running of the macro either toggles the highlighting on or
off.
Syntax_Load("gre.syn") Config(PG_E_SYNTAX,Config(PG_E_SYNTAX)==0,LOCAL)
This macro was suggested by Christian in the previous posting in this
thread, Thanks Christian:-). My initial posting suggested an inferior macro
to do this. Christian's method is truly elegant! I suspect its the standard
approach for toggling but for me its eye opening! Nice to have it available!
An even simpler way of accessing the macro is to dedicate it to a key in
vedit.key. E.G if the F12 key is to be dedicated as a toggle key, then add
the following line to vedit.key
F12 [visual exit] Syntax_Load("gre.syn") Config(PG_E_SYNTAX,Config(PG_E_SYNTAX)==0,LOCAL)
Actually, though I read Christain's method over a year ago, I did not bother
to apply his improved method because my method, shown in the my initial
posting of this thread, was working fine.
However, after recently installing vpw V5.2, and keeping my previous(5.16)
config I found that I kept on getting the error message "cannot find |L". In
contrast, Christian's method works fine. I have no idea why this is so.
Anybody?
The attached gsi-8.syn is for easy reading of Leica 8 digit gsi survey data
files where measurement and code blocks are utilized. The colour coding
is setup for Geocomp's field coding for Leica instruments.
..Steve
|
|