Colour highlight without spaces

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Haydn Langley

Colour highlight without spaces

Post by Haydn Langley »

I wish to highlight key words that don't contain spaces. For example, -ldiXYZ should have the ldi highlighted as the syntax. Is this possible?
Thanks in advance
Murray Tyler

Re: Colour highlight without spaces

Post by Murray Tyler »

Are all your keywords of fixed length? (ie 3 characters in your example)

If so, then I think you can edit (or create) the syntax definition file for the file type in question (.syn file) and set KeyWordLength = 3, then provide a list of keywords in the keyword section.

See help -> contents -> reference information -> syntax definition files

Regards

Murray
Haydn Langley

Re: Colour highlight without spaces

Post by Haydn Langley »

Thanks for the quick response - but unfortunately it does not work! There is no keyword KeyWordLength. In answer to the question, all the keywords do have a length of 3.

Any other suggestions out there?

Cheers
Haydn
Forrest

Re: Colour highlight without spaces

Post by Forrest »

There is KeyWordLength= but it depends on this: HTML=1.

Which can be
C=1
HTML=1
LaTeX=1
TEXT=1

Your selection determines the options available.
But I wish I understood what's really going on with that. There is scant explanation in help an customer service won't answer.




HTML=1

[Syntax]
Namespace1 = 2
IgnoreCase = Yes
KeyWordLength =
BracketChars =
OperatorChars =
PreprocStart =
HexPrefix = #
Murray Tyler

Re: Colour highlight without spaces

Post by Murray Tyler »

You can use C=1 as well and it should work.

Try this example

; TextPad syntax definition
;

C=1

[Syntax]
Namespace1 = 6
IgnoreCase = Yes (or no, dependent on what you require)
KeyWordLength = 3
BracketChars = {[()]}
OperatorChars =
PreprocStart =
SyntaxStart =
SyntaxEnd =
HexPrefix =
CommentStart =
CommentEnd =
CommentStartAlt =
CommentEndAlt =
SingleComment =
SingleCommentCol =
SingleCommentAlt =
SingleCommentColAlt =
SingleCommentEsc =
StringsSpanLines = No
StringStart =
StringEnd =
StringAlt =
StringEsc =
CharStart =
CharEnd =
CharEsc =

[Keywords 1]
ldi
...Put the rest of your keywords here


Hope this helps

Murray
Haydn Langley

Re: Colour highlight without spaces

Post by Haydn Langley »

Thanks for all the help - but I still have a problem! It seems as though my version of Text Pad will not accept KeyWordLength. Is there a version that does accept this?

Thanks again in advance.

Haydn
Forrest

Re: Colour highlight without spaces

Post by Forrest »

It would be so nice if we could read somewhere what keywordlength even means! I was ready to do a presentation to the ATLAS programmers at my company, Lockheed-Martin, and try to convince them to buy many licenses. But I can't figure out the entire capabilities of TextPad. To a limited degree support answers questions but not completely.
It's a great program but for the life of me I can't fugure out that company!
Murray Tyler

Re: Colour highlight without spaces

Post by Murray Tyler »

I'm using version 4.5, which seems to work OK.

Murray
Haydn Langley

Re: Colour highlight without spaces

Post by Haydn Langley »

Thanks Murray - and thanks to all who reqponded to my query.

Yesterday I downloaded the latest version of TextPad (v4.5) and I now have my syntax highlighting working!

It is great to have a forum where there are honest answers to questions without the spam often found on web sites.

Haydn
Post Reply