Page 1 of 1

Syntax file problem

Posted: Fri Feb 15, 2002 7:18 pm
by Steve Lovejoy
Hi;
I've been browsing the Forum and also looking at the Help quite a bit, but still have a number of questions. I am using TextPad 4.5 to edit extensive MSSQL stored procedures. I am having limited success with the syntax highlighting.

My .syn file has 6 keywords sections. Looking at configure|Preferences .. colors it appears one can set a separate color for each section. However, I am not able to make this happen consistently. I cannot find a pattern which explains "why".

Perhaps someone could explain how syntax highlighting actually works. Is the text file (TSQL.syn) parsed "real time", or is there some kind of compile that takes place? If the latter, how do I force it?

Why would one keyword in a particular section be the "right" color and the one next to it be wrong? I have checked and they are not repeated across sections. As I have over a thousand lines in the file; could it be that "partial matches" are the problem? I would have thought the parser would look for a space terminating any of the keywords ... ie: cat and dog might be keywords, but catdog or dogcat should not be highlit unless this too is a keyword. Am I wrong?

I am not clear from the Help whether I can expect more than one color to work at all. (Though I do have 3 colours "working" to some degree at present). While the Config seems to offer up to 6, there is talk about namespaces being Maxed at 2. I think I understand that this is for situations where the same word is reused as a keyword in different contexts. Am I correct, can we use up to 6 colours?

Hope someone has the patience to answer my question. Textpad has been a huge boone for me over the years. I have written several large projects with its help.

If I get this working satisfactorily, I'll post it to the "Add-Ons" section. I know there are several MSSQL syn files there (and I have borrowed from them heavily), but this takes an approach which combines MSSQL's native interface highlighting with Delphi sysntax highlighting. It may be handy for at least one more person out there!