Thank-You,
Kyle
No virus found in this incoming message.
Checked by AVG.
Version: 8.0.101 / Virus Database: 270.4.3/1526 - Release Date: 6/30/2008
8:43 AM
> I use TSE like a database because it is so fast.
Just shaking hands
----- Original Message ----
From: noman9607 <pgb...@yahoo.com>
To: SemWare <sem...@googlegroups.com>
Sent: Wednesday, July 2, 2008 7:25:04 PM
Subject: [TSE] Re: syntax highlight on the fly?
Here is a current example. I have the novel "Don Quixote" loaded (from
project Gutenberg) to study and later write a paper. I use TSE like a
Points of interest:
- The .syn file needs to be loaded in binary mode 2.
See in TSE's Help the topic BinaryMode() for an explanation.
- Syncfg2 converts to an unsaved file in the CURRENT directory.
- The TSE compiler does not understand the documented LinkSynFile
parameter _ALWAYS_LOAD_: use -1 instead.
*/
string syntaxfile_name [255] = "f:\tse32\synhi\sal.syn"
proc Main()
integer original_id = GetBufferId()
integer syntaxfile_id = EditThisFile("-b-2 " + syntaxfile_name)
integer textfile_id = 0
ExecMacro("syncfg2")
if CurrExt() == ".txt" // Did syncfg2 succeed?
textfile_id = GetBufferId()
AbandonFile(syntaxfile_id)
// Toggle syntax hiliting for "proc".
if lFind("proc", "giw")
lReplace("proc", "noproc", "ginw")
else
lReplace("noproc", "proc", "ginw")
endif
ExecMacro("syncfg2")
if CurrExt() == ".syn" // Did syncfg2 succeed?
syntaxfile_id = GetBufferId()
AbandonFile(textfile_id)
// Saving .syn file using original dir instead of current dir!
SaveAs(syntaxfile_name, _OVERWRITE_)
GotoBufferId(original_id)
AbandonFile(syntaxfile_id)
// Relink the new syntax hiliting file ALWAYS (-1).
LinkSynFile(syntaxfile_name, -1)
UpdateDisplay(_ALL_WINDOWS_REFRESH_) // Just in case.
endif
endif
PurgeMacro(SplitPath(CurrMacroFilename(), _NAME_))
end