Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Syntax Edit
  New Posts New Posts RSS Feed - Coloring Class Begin and End Keywords
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Coloring Class Begin and End Keywords

 Post Reply Post Reply
Author
Message
The General View Drop Down
Newbie
Newbie


Joined: 05 August 2012
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote The General Quote  Post ReplyReply Direct Link To This Post Topic: Coloring Class Begin and End Keywords
    Posted: 05 August 2012 at 7:15pm
Hi All,

Would like to know how to go about coloring the start and end keywords of a class. The below is a prime example:

Private Sub
.....
.....
End Sub

Now each of those words is defined as a keyword and formatted properly on their own but when used to gether (and therefore qualify for a class sytart / end descriptor), the colorisation goes to the default (eg black). Naturally I cannot simply set the text forecolor for the class as this will color each word within the class (ie within the class start and end descriptors).

The only way that I can see (which seems like overkill) is to define (eg) 'Private Sub' as it's own class, colorise that, do the same for 'End Sub' and then have another class which starts and ends with these classes.

There must be an easier way I'm overlooking, right ?? Any and all help appreciated ! Smile

The General.
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 15 August 2012 at 1:37pm

Here is a very basic class to do this.  You will also need those keywords defined in the keywords section if you want them colored when not used in a block or as they type them.

lexClass:
 name   = c_Basic
 parent:file  = <*.vbs>
 caseSensitive  = 0

lexClass:
 name  = c_BasicCodeBlock_Start 
 parent  = c_Basic, c_BasicCodeBlock
 children = 0
 start:Tag = 'Private Sub'
 end:Separators = '\t', ' ', @eol
 txt:colorFG = 0x0000FF
 
lexClass:
 name  = c_BasicCodeBlock_End 
 parent  = c_Basic, c_BasicCodeBlock
 children = 0
 previous:tag = @specs, ' ', '\t', @eol
 start:Tag = 'End Sub'
 end:Separators = @specs, @eol
 txt:colorFG = 0x0000FF

lexClass:
 name  = c_BasicCodeBlock
 parent  = c_Basic, c_BasicCodeBlock
 start:CLASS = c_BasicCodeBlock_Start
 end:CLASS = c_BasicCodeBlock_End
 Collapsable = 1
 CollapsedText = '...'

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 16 August 2012 at 3:20pm
Attached updated vb.net style schema to your support ticket
Back to Top
The General View Drop Down
Newbie
Newbie


Joined: 05 August 2012
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote The General Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2012 at 12:57am
A little belated but thanks for the support. Smile
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 3.374 seconds.