Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TGML 1

Status
Not open for further replies.

earthandfire

Programmer
Mar 14, 2005
2,924
GB
ZmrAbdulla posed a problem in thread796-1152284, which both ca8msm and I found very interesting and intriguing. In one of his replies ca8msm sugested that it would be a good idea if we could have a mechanism to embed colour tags between [code] [/code] tags.

This got me thinking. I can see two possible solutions.

1)
Create a VS AddIn. This would (hopefully) enable us to see the formatting used and then we would be able to pick up the colours and output a document with the appropriate formatting. I don't, however, see this as the easy option.

2)
Create a program that will parse a block of text looking for key features. For example the apostrophe could indicate that what follows should be green. A list of reserved words could be used to match up blue. Obviously this is a very simplistic summary, but, I think far more achievable than option 1. This could then be extended to support the rainbow of colours used in SQL Server.

I intend to experiment with option two.

I've posted this a separate topic in the hope that it will ignite some interest. I was actually quite surprised that so few contributors posted to the other thread.


[vampire][bat]
 
You were handling it very well. Being a genius myself, I can see another one a mile away.

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Sounds good E&F - I guess the only problem will be knowing which KeyWords generate a different colour and when to colour them. e.g.

Dim s As String - In this example you'd have to colour Dim, As and String in Blue

s = "Dim s As String" - In this example you wouldn't want to colour any of the Dim, As or String words

It's probably easiest to store all the keywords in an XML file under a node which contains their colour as if we miss any they can easily be updated - it's just figuring out when to use them and when not to!


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Its going to be another fun exercise. We'll have to get chrissie to do any necessary RegEx for us [wink]

[vampire][bat]
 
I'll be glad to, but it could take a couple of months.

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
First draft:

Code:
[Blue]Public[/Blue] [Blue]Class[/Blue] Form4 
    [Blue]Inherits[/Blue] System.Windows.Forms.Form 
 
#[Blue]Region[/Blue] " Windows Form Designer generated code " 
 
    [Blue]Public[/Blue] [Blue]Sub[/Blue] New() 
        MyBase.New() 
 
        [Green]'This call is required by the Windows Form Designer. [/Green]
        InitializeComponent() 
 
        [Green]'Add any initialization after the InitializeComponent() call [/Green]
 
    [Blue]End[/Blue] [Blue]Sub[/Blue] 
 
    [Green]'Form overrides dispose to clean up the component list. [/Green]
    [Blue]Protected[/Blue] [Blue]Overloads[/Blue] [Blue]Overrides[/Blue] [Blue]Sub[/Blue] Dispose(ByVal disposing [Blue]As[/Blue] Boolean) 
        [Blue]If[/Blue] disposing [Blue]Then[/Blue] 
            [Blue]If[/Blue] Not (components [Blue]Is[/Blue] Nothing) [Blue]Then[/Blue] 
                components.Dispose() 
            [Blue]End[/Blue] [Blue]If[/Blue] 
        [Blue]End[/Blue] [Blue]If[/Blue] 
        MyBase.Dispose(disposing) 
    [Blue]End[/Blue] [Blue]Sub[/Blue] 
 
    [Green]'Required by the Windows Form Designer [/Green]
    [Blue]Private[/Blue] components [Blue]As[/Blue] System.ComponentModel.IContainer 
 
    [Green]'NOTE: The following procedure is required by the Windows Form Designer [/Green]
    [Green]'It can be modified using the Windows Form Designer.   [/Green]
    [Green]'Do not modify it using the code editor. [/Green]
  [Blue]Friend[/Blue] WithEvents TextBox1 [Blue]As[/Blue] System.Windows.Forms.TextBox 
  [Blue]Friend[/Blue] WithEvents TextBox2 [Blue]As[/Blue] System.Windows.Forms.TextBox 
  [Blue]Friend[/Blue] WithEvents btnLoadTable [Blue]As[/Blue] System.Windows.Forms.Button 
  [Blue]Friend[/Blue] WithEvents btnInsertCodes [Blue]As[/Blue] System.Windows.Forms.Button 
  <System.Diagnostics.DebuggerStepThrough()> [Blue]Private[/Blue] [Blue]Sub[/Blue] InitializeComponent() 
    Me.btnLoadTable = [Blue]New[/Blue] System.Windows.Forms.Button 
    Me.TextBox1 = [Blue]New[/Blue] System.Windows.Forms.TextBox 
    Me.TextBox2 = [Blue]New[/Blue] System.Windows.Forms.TextBox 
    Me.btnInsertCodes = [Blue]New[/Blue] System.Windows.Forms.Button 
    Me.SuspendLayout() 
    [Green]' [/Green]
    [Green]'btnLoadTable [/Green]
    [Green]' [/Green]
    Me.btnLoadTable.Location = [Blue]New[/Blue] System.Drawing.Point(560, 16) 
    Me.btnLoadTable.Name = "btnLoadTable" 
    Me.btnLoadTable.TabIndex = 0 
    Me.btnLoadTable.Text = "Load Table" 
    [Green]' [/Green]
    [Green]'TextBox1 [/Green]
    [Green]' [/Green]
    Me.TextBox1.Location = [Blue]New[/Blue] System.Drawing.Point(0, 0) 
    Me.TextBox1.Multiline = [Blue]True[/Blue] 
    Me.TextBox1.Name = "TextBox1" 
    Me.TextBox1.Size = [Blue]New[/Blue] System.Drawing.Size(448, 200) 
    Me.TextBox1.TabIndex = 1 
    Me.TextBox1.Text = "" 
    [Green]' [/Green]
    [Green]'TextBox2 [/Green]
    [Green]' [/Green]
    Me.TextBox2.Location = [Blue]New[/Blue] System.Drawing.Point(0, 216) 
    Me.TextBox2.Multiline = [Blue]True[/Blue] 
    Me.TextBox2.Name = "TextBox2" 
    Me.TextBox2.Size = [Blue]New[/Blue] System.Drawing.Size(448, 200) 
    Me.TextBox2.TabIndex = 2 
    Me.TextBox2.Text = "" 
    [Green]' [/Green]
    [Green]'btnInsertCodes [/Green]
    [Green]' [/Green]
    Me.btnInsertCodes.Location = [Blue]New[/Blue] System.Drawing.Point(560, 64) 
    Me.btnInsertCodes.Name = "btnInsertCodes" 
    Me.btnInsertCodes.TabIndex = 3 
    Me.btnInsertCodes.Text = "Insert Codes" 
    [Green]' [/Green]
    [Green]'Form4 [/Green]
    [Green]' [/Green]
    Me.AutoScaleBaseSize = [Blue]New[/Blue] System.Drawing.Size(5, 13) 
    Me.ClientSize = [Blue]New[/Blue] System.Drawing.Size(664, 373) 
    Me.Controls.Add(Me.btnInsertCodes) 
    Me.Controls.Add(Me.TextBox2) 
    Me.Controls.Add(Me.TextBox1) 
    Me.Controls.Add(Me.btnLoadTable) 
    Me.Name = "Form4" 
    Me.Text = "Form4" 
    Me.ResumeLayout(False) 
 
  [Blue]End[/Blue] [Blue]Sub[/Blue] 
 
#[Blue]End[/Blue] [Blue]Region[/Blue] 
 
  [Blue]Private[/Blue] ht [Blue]As[/Blue] [Blue]New[/Blue] Hashtable 
  [Blue]Private[/Blue] Lines() [Blue]As[/Blue] [Blue]String[/Blue] 
  [Blue]Private[/Blue] Words() [Blue]As[/Blue] [Blue]String[/Blue] 
  [Blue]Private[/Blue] Quote [Blue]As[/Blue] [Blue]String[/Blue] = """" 
  [Blue]Private[/Blue] Comment [Blue]As[/Blue] [Blue]String[/Blue] = "'" 
 
  [Blue]Private[/Blue] QuoteActive [Blue]As[/Blue] [Blue]Boolean[/Blue] = [Blue]False[/Blue] 
  [Blue]Private[/Blue] CommentActive [Blue]As[/Blue] [Blue]Boolean[/Blue] = [Blue]False[/Blue] 
 
  [Blue]Private[/Blue] [Blue]Sub[/Blue] btnLoadTable_Click(ByVal sender [Blue]As[/Blue] System.Object, [Blue]ByVal[/Blue] e [Blue]As[/Blue] System.EventArgs) [Blue]Handles[/Blue] btnLoadTable.Click 
 
    [Green]'This list just includes the words in the program so far [/Green]
    ht.Clear() 
    ht.Add("Dim", "Blue") 
    ht.Add("As", "Blue") 
    ht.Add("Sub", "Blue") 
    ht.Add("Function", "Blue") 
    ht.Add("End", "Blue") 
    ht.Add("Private", "Blue") 
    ht.Add("New", "Blue") 
    ht.Add("While", "Blue") 
    ht.Add("If", "Blue") 
    ht.Add("Then", "Blue") 
    ht.Add("Else", "Blue") 
    ht.Add("For", "Blue") 
    ht.Add("Next", "Blue") 
    ht.Add("To", "Blue") 
    ht.Add("ByVal", "Blue") 
    ht.Add("Handles", "Blue") 
    ht.Add("Return", "Blue") 
    ht.Add("String", "Blue") 
    ht.Add("Integer", "Blue") 
    ht.Add("Boolean", "Blue") 
    ht.Add("False", "Blue") 
    ht.Add("True", "Blue") 
    ht.Add("MyBase", "Blue") 
    ht.Add("Protected", "Blue") 
    ht.Add("Overrides", "Blue") 
    ht.Add("Friend", "Blue") 
    ht.Add("Overloads", "Blue") 
    ht.Add("Is", "Blue") 
    ht.Add("Nothing", "Blue") 
    ht.Add("Me", "Blue") 
    ht.Add("Class", "Blue") 
    ht.Add("Public", "Blue") 
    ht.Add("Inherits", "Blue") 
    ht.Add("Region", "Blue") 
    ht.Add("#Region", "Blue") 
    ht.Add("#End", "Blue") 
 
  [Blue]End[/Blue] [Blue]Sub[/Blue] 
 
  [Blue]Private[/Blue] [Blue]Function[/Blue] GetCodedString(ByVal w [Blue]As[/Blue] String, [Blue]ByVal[/Blue] value [Blue]As[/Blue] String) [Blue]As[/Blue] [Blue]String[/Blue] 
 
    [Green]'#Region and #End Region are special cases so handle it separately [/Green]
    [Blue]If[/Blue] w = "#Region" Or w = "#End" [Blue]Then[/Blue] 
      [Blue]Return[/Blue] "#[" + value + "]" + w.Substring(1) + "[/" + value + "] " 
    [Blue]Else[/Blue] 
      [Blue]Return[/Blue] "[" + value + "]" + w + "[/" + value + "] " 
    [Blue]End[/Blue] [Blue]If[/Blue] 
 
  [Blue]End[/Blue] [Blue]Function[/Blue] 
 
  [Blue]Private[/Blue] [Blue]Sub[/Blue] btnInsertCodes_Click(ByVal sender [Blue]As[/Blue] System.Object, [Blue]ByVal[/Blue] e [Blue]As[/Blue] System.EventArgs) [Blue]Handles[/Blue] btnInsertCodes.Click 
 
    TextBox2.Text = "" 
    [Blue]If[/Blue] TextBox1.Text.Length = 0 [Blue]Then[/Blue] Exit [Blue]Sub[/Blue] [Green]'Get out if no text [/Green]
    TextBox1.Text = TextBox1.Text.Trim 
    [Green]'Clean up the string [/Green]
    [Blue]Dim[/Blue] s [Blue]As[/Blue] [Blue]String[/Blue] = TextBox1.Text.Replace(vbLf, "") 
    Lines = s.Split(vbCr.ToCharArray) 
    [Blue]For[/Blue] a [Blue]As[/Blue] [Blue]Integer[/Blue] = 0 [Blue]To[/Blue] Lines.Length - 1 
      Words = Lines(a).Split(" "c) 
      For b As Integer = 0 To Words.Length - 1 
        If QuoteActive Then 
          TextBox2.Text += Words(b) + " " 
          [Blue]If[/Blue] Words(b).EndsWith(Quote) [Blue]Then[/Blue] QuoteActive = [Blue]False[/Blue] 
        [Blue]Else[/Blue] 
          [Blue]If[/Blue] Words(b).StartsWith(Quote) Or Words(b).StartsWith("(" + Quote) [Blue]Then[/Blue] 
            TextBox2.Text += Words(b) + " " 
            [Blue]If[/Blue] Not (Words(b).EndsWith(Quote) Or Words(b).EndsWith(Quote + ")")) Then QuoteActive = True 
          Else 
            If CommentActive Then 
              TextBox2.Text += Words(b) + " " 
            [Blue]Else[/Blue] 
              [Blue]If[/Blue] Words(b).StartsWith(Comment) [Blue]Then[/Blue] 
                CommentActive = [Blue]True[/Blue] 
                TextBox2.Text += "[Green]" + Words(b) + " " 
              [Blue]Else[/Blue] 
                [Blue]If[/Blue] ht.ContainsKey(Words(b)) [Blue]Then[/Blue] 
                  TextBox2.Text += GetCodedString(Words(b), ht.Item(Words(b)).ToString) 
                [Blue]Else[/Blue] 
                  TextBox2.Text += Words(b) + " " 
                [Blue]End[/Blue] [Blue]If[/Blue] 
              [Blue]End[/Blue] [Blue]If[/Blue] 
            [Blue]End[/Blue] [Blue]If[/Blue] 
          [Blue]End[/Blue] [Blue]If[/Blue] 
        [Blue]End[/Blue] [Blue]If[/Blue] 
      [Blue]Next[/Blue] 
      [Blue]If[/Blue] CommentActive [Blue]Then[/Blue] 
        TextBox2.Text += "[/Green]" 
        CommentActive = [Blue]False[/Blue] 
      [Blue]End[/Blue] [Blue]If[/Blue] 
      TextBox2.Text += Environment.NewLine 
    [Blue]Next[/Blue] 
 
  [Blue]End[/Blue] [Blue]Sub[/Blue] 
[Blue]End[/Blue] [Blue]Class[/Blue]


This part has unfortunately been TGML'd and as such has come out slightly wrong:

TextBox2.Text += "" + Words(b) + " "
Else
If ht.ContainsKey(Words(b)) Then
TextBox2.Text += GetCodedString(Words(b), ht.Item(Words(b)).ToString)
Else
TextBox2.Text += Words(b) + " "
End If
End If
End If
End If
End If
Next
If CommentActive Then
TextBox2.Text += ""


This is what it actually looks like:

TextBox2.Text += "[Green]" + Words(b) + " "
[Blue]Else[/Blue]
[Blue]If[/Blue] ht.ContainsKey(Words(b)) [Blue]Then[/Blue]
TextBox2.Text += GetCodedString(Words(b), ht.Item(Words(b)).ToString)
[Blue]Else[/Blue]
TextBox2.Text += Words(b) + " "
[Blue]End[/Blue] [Blue]If[/Blue]
[Blue]End[/Blue] [Blue]If[/Blue]
[Blue]End[/Blue] [Blue]If[/Blue]
[Blue]End[/Blue] [Blue]If[/Blue]
[Blue]End[/Blue] [Blue]If[/Blue]
[Blue]Next[/Blue]
[Blue]If[/Blue] CommentActive [Blue]Then[/Blue]
TextBox2.Text += "End Of Green Tag goes here"


Not the best structured code - but something to play with.

As far as a data structure to hold the Keywords and Colours is concerned, I chose a HashTable for this exercise because it was quick and easy to set up. If this is developed further, then I would probably look at something a bit more substantial.



[vampire][bat]
 
The main points still to be handled (which I've made a start on with the code for #Region and #End Region) are things like:
[tt]
MyBase. needs blue tags
New( needs blue tags
(ByVal needs blue tags
(ByRef needs blue tags
[/tt]
but I thought I leave something for others to do [wink]

[vampire][bat]
 
A couple of extra things:

I've just discovered the Ignore tags - so I've reposted the sub with them at "judicious" locations.

The Comment handler would need to be enhanced to support languages that allow multi-line comments such as SQL, C# and Delphi.

So still some work to do.

Code:
[Blue]Private[/Blue] [Blue]Sub[/Blue] btnInsertCodes_Click(ByVal sender [Blue]As[/Blue] System.Object, [Blue]ByVal[/Blue] e [Blue]As[/Blue] System.EventArgs) [Blue]Handles[/Blue] btnInsertCodes.Click 
 
    TextBox2.Text = "[Code]" 
    [Blue]If[/Blue] TextBox1.Text.Length = 0 [Blue]Then[/Blue] Exit [Blue]Sub[/Blue] [Green]'Get out if no text [/Green]
    TextBox1.Text = TextBox1.Text.Trim 
    [Green]'Clean up the string [/Green]
    [Blue]Dim[/Blue] s [Blue]As[/Blue] [Blue]String[/Blue] = TextBox1.Text.Replace(vbLf, "") 
    Lines = s.Split(vbCr.ToCharArray) 
    [Blue]For[/Blue] a [Blue]As[/Blue] [Blue]Integer[/Blue] = 0 [Blue]To[/Blue] Lines.Length - 1 
      Words = Lines(a).Split(" "c) 
      For b As Integer = 0 To Words.Length - 1 
        If QuoteActive Then 
          TextBox2.Text += Words(b) + " " 
          [Blue]If[/Blue] Words(b).EndsWith(Quote) [Blue]Then[/Blue] QuoteActive = [Blue]False[/Blue] 
        [Blue]Else[/Blue] 
          [Blue]If[/Blue] Words(b).StartsWith(Quote) Or Words(b).StartsWith("(" + Quote) [Blue]Then[/Blue] 
            TextBox2.Text += Words(b) + " " 
            [Blue]If[/Blue] Not (Words(b).EndsWith(Quote) Or Words(b).EndsWith(Quote + ")")) Then QuoteActive = True 
          Else 
            If CommentActive Then 
              TextBox2.Text += Words(b) + " " 
            [Blue]Else[/Blue] 
              [Blue]If[/Blue] Words(b).StartsWith(Comment) [Blue]Then[/Blue] 
                CommentActive = [Blue]True[/Blue] 
                TextBox2.Text += "[Green]" + Words(b) + " " 
              [Blue]Else[/Blue] 
                [Blue]If[/Blue] ht.ContainsKey(Words(b)) [Blue]Then[/Blue] 
                  TextBox2.Text += GetCodedString(Words(b), ht.Item(Words(b)).ToString) 
                [Blue]Else[/Blue] 
                  TextBox2.Text += Words(b) + " " 
                [Blue]End[/Blue] [Blue]If[/Blue] 
              [Blue]End[/Blue] [Blue]If[/Blue] 
            [Blue]End[/Blue] [Blue]If[/Blue] 
          [Blue]End[/Blue] [Blue]If[/Blue] 
        [Blue]End[/Blue] [Blue]If[/Blue] 
      [Blue]Next[/Blue] 
      [Blue]If[/Blue] CommentActive [Blue]Then[/Blue] 
        TextBox2.Text += "[Ignore][/Green][/Ignore]" 
        CommentActive = [Blue]False[/Blue] 
      [Blue]End[/Blue] [Blue]If[/Blue] 
      TextBox2.Text += Environment.NewLine 
    [Blue]Next[/Blue] 
    TextBox2.Text += "[Ignore]
[/Ignore]"

[Blue]End[/Blue] [Blue]Sub[/Blue]
[/Code]

[vampire][bat]
 
I will just add my signature in this thread so that I can see the progress. I will mereley contribute anything here.

However, My application what I mentioned in thread796-1152284 is giving you a visual effect of what you are going to do. I have concentrated on using all the tags with mouse click because I am a fan of mouse.

It is better to have, when you type "[" in the editor you will presented with the list of tags by the artificial intellisence, choose one of it. Begin and end tag will be added to the textbox. Those are typing fast find this useful.

There is a utility in the TT UK forum called TGML STAR by Steve. I can't find the link now.
I believe some of the posters in the Access Forums using their own tag formatter as you see their posts are very colorful.(or they are very accurate typists [wink])


________________________________________________________
Zameer Abdulla
Help to find Missing people
Do not cut down the tree that gives you shade.
 
If you go to you can see their message writer box (in advanced mode) supports all TGML similar tags. There are few others don't remeber now.

If TT also provides then it is easy here. Or we need to create a MS Word like text editor that support formatting and convert the formatting to TGML tags

________________________________________________________
Zameer Abdulla
Help to find Missing people
Do not cut down the tree that gives you shade.
 
Test

Code:
[Blue]If[/Blue] strCode.Length = 0 [Blue]Then[/Blue] 
            [Green]'Get out if no text [/Green]
            strTGMLCode = [Red]"" [/Red]
            [Blue]Exit[/Blue] [Blue]Sub[/Blue] 
        [Blue]End[/Blue] [Blue]If[/Blue] 
 
        strCode = strCode.Trim 
        [Green]'Clean up the string  [/Green]
        [Blue]Dim[/Blue] s [Blue]As[/Blue] [Blue]String[/Blue] = strCode.Replace(vbLf, [Red]"") [/Red]
        [Blue]Dim[/Blue] Lines [Blue]As[/Blue] String() 
        [Blue]Dim[/Blue] Words() [Blue]As[/Blue] [Blue]String[/Blue] 
        [Blue]Dim[/Blue] [Red]Quote[/Red] [Blue]As[/Blue] [Blue]String[/Blue] = [Red]"""" [/Red]
        [Blue]Dim[/Blue] [Green]Comment[/Green] [Blue]As[/Blue] [Blue]String[/Blue] = [Red]"'" [/Red]
        [Blue]Dim[/Blue] objTGMLTag [Blue]As[/Blue] TGMLTag 
 
        [Blue]Dim[/Blue] QuoteActive [Blue]As[/Blue] [Blue]Boolean[/Blue] = [Blue]False[/Blue] 
        [Blue]Dim[/Blue] CommentActive [Blue]As[/Blue] [Blue]Boolean[/Blue] = [Blue]False[/Blue] 
 
        Lines = s.Split(vbCr.ToCharArray) 
        strTGMLCode += [Red]"[Code]" [/Red]+ ControlChars.CrLf

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Almost there ...

Code:
[Blue]Public[/Blue] [Blue]Class[/Blue] Form6
    [Blue]Inherits[/Blue] System.Windows.Forms.Form

#[Blue]Region[/Blue] " Windows Form Designer generated code "

    [Blue]Public[/Blue] [Blue]Sub[/Blue] [Blue]New[/Blue]()
        [Blue]MyBase[/Blue].[Blue]New[/Blue]()

        [Green]'This call is required by the Windows Form Designer.[/Green]
        InitializeComponent()

        [Green]'Add any initialization after the InitializeComponent() call[/Green]

    [Blue]End[/Blue] [Blue]Sub[/Blue]

    [Green]'Form overrides dispose to clean up the component list.[/Green]
    [Blue]Protected[/Blue] [Blue]Overloads[/Blue] [Blue]Overrides[/Blue] [Blue]Sub[/Blue] Dispose([Blue]ByVal[/Blue] disposing [Blue]As[/Blue] [Blue]Boolean[/Blue])
        [Blue]If[/Blue] disposing [Blue]Then[/Blue]
            [Blue]If[/Blue] Not (components [Blue]Is[/Blue] [Blue]Nothing[/Blue]) [Blue]Then[/Blue]
                components.Dispose()
            [Blue]End[/Blue] [Blue]If[/Blue]
        [Blue]End[/Blue] [Blue]If[/Blue]
        [Blue]MyBase[/Blue].Dispose(disposing)
    [Blue]End[/Blue] [Blue]Sub[/Blue]

    [Green]'Required by the Windows Form Designer[/Green]
    [Blue]Private[/Blue] components [Blue]As[/Blue] System.ComponentModel.IContainer

    [Green]'NOTE: The following procedure is required by the Windows Form Designer[/Green]
    [Green]'It can be modified using the Windows Form Designer.  [/Green]
    [Green]'Do not modify it using the code editor.[/Green]
  [Blue]Friend[/Blue] WithEvents TextBox1 [Blue]As[/Blue] System.Windows.Forms.TextBox
  [Blue]Friend[/Blue] WithEvents TextBox2 [Blue]As[/Blue] System.Windows.Forms.TextBox
  [Blue]Friend[/Blue] WithEvents btnLoadTable [Blue]As[/Blue] System.Windows.Forms.Button
  [Blue]Friend[/Blue] WithEvents btnInsertCodes [Blue]As[/Blue] System.Windows.Forms.Button
  <System.Diagnostics.DebuggerStepThrough()> [Blue]Private[/Blue] [Blue]Sub[/Blue] InitializeComponent()
    [Blue]Me[/Blue].TextBox1 = [Blue]New[/Blue] System.Windows.Forms.TextBox
    [Blue]Me[/Blue].TextBox2 = [Blue]New[/Blue] System.Windows.Forms.TextBox
    [Blue]Me[/Blue].btnLoadTable = [Blue]New[/Blue] System.Windows.Forms.Button
    [Blue]Me[/Blue].btnInsertCodes = [Blue]New[/Blue] System.Windows.Forms.Button
    [Blue]Me[/Blue].SuspendLayout()
    [Green]'[/Green]
    [Green]'TextBox1[/Green]
    [Green]'[/Green]
    [Blue]Me[/Blue].TextBox1.Location = [Blue]New[/Blue] System.Drawing.Point(16, 16)
    [Blue]Me[/Blue].TextBox1.Multiline = [Blue]True[/Blue]
    [Blue]Me[/Blue].TextBox1.Name = "TextBox1"
    [Blue]Me[/Blue].TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
    [Blue]Me[/Blue].TextBox1.Size = [Blue]New[/Blue] System.Drawing.Size(552, 216)
    [Blue]Me[/Blue].TextBox1.TabIndex = 0
    [Blue]Me[/Blue].TextBox1.Text = "TextBox1"
    [Green]'[/Green]
    [Green]'TextBox2[/Green]
    [Green]'[/Green]
    [Blue]Me[/Blue].TextBox2.Location = [Blue]New[/Blue] System.Drawing.Point(24, 240)
    [Blue]Me[/Blue].TextBox2.Multiline = [Blue]True[/Blue]
    [Blue]Me[/Blue].TextBox2.Name = "TextBox2"
    [Blue]Me[/Blue].TextBox2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
    [Blue]Me[/Blue].TextBox2.Size = [Blue]New[/Blue] System.Drawing.Size(552, 232)
    [Blue]Me[/Blue].TextBox2.TabIndex = 1
    [Blue]Me[/Blue].TextBox2.Text = "TextBox2"
    [Green]'[/Green]
    [Green]'btnLoadTable[/Green]
    [Green]'[/Green]
    [Blue]Me[/Blue].btnLoadTable.Location = [Blue]New[/Blue] System.Drawing.Point(600, 24)
    [Blue]Me[/Blue].btnLoadTable.Name = "btnLoadTable"
    [Blue]Me[/Blue].btnLoadTable.Size = [Blue]New[/Blue] System.Drawing.Size(80, 23)
    [Blue]Me[/Blue].btnLoadTable.TabIndex = 2
    [Blue]Me[/Blue].btnLoadTable.Text = "Load Table"
    [Green]'[/Green]
    [Green]'btnInsertCodes[/Green]
    [Green]'[/Green]
    [Blue]Me[/Blue].btnInsertCodes.Location = [Blue]New[/Blue] System.Drawing.Point(600, 72)
    [Blue]Me[/Blue].btnInsertCodes.Name = "btnInsertCodes"
    [Blue]Me[/Blue].btnInsertCodes.Size = [Blue]New[/Blue] System.Drawing.Size(80, 23)
    [Blue]Me[/Blue].btnInsertCodes.TabIndex = 3
    [Blue]Me[/Blue].btnInsertCodes.Text = "Insert Codes"
    [Green]'[/Green]
    [Green]'Form6[/Green]
    [Green]'[/Green]
    [Blue]Me[/Blue].AutoScaleBaseSize = [Blue]New[/Blue] System.Drawing.Size(5, 13)
    [Blue]Me[/Blue].ClientSize = [Blue]New[/Blue] System.Drawing.Size(696, 469)
    [Blue]Me[/Blue].Controls.Add([Blue]Me[/Blue].btnInsertCodes)
    [Blue]Me[/Blue].Controls.Add([Blue]Me[/Blue].btnLoadTable)
    [Blue]Me[/Blue].Controls.Add([Blue]Me[/Blue].TextBox2)
    [Blue]Me[/Blue].Controls.Add([Blue]Me[/Blue].TextBox1)
    [Blue]Me[/Blue].Name = "Form6"
    [Blue]Me[/Blue].Text = "Form6"
    [Blue]Me[/Blue].WindowState = System.Windows.Forms.FormWindowState.Maximized
    [Blue]Me[/Blue].ResumeLayout([Blue]False[/Blue])

  [Blue]End[/Blue] [Blue]Sub[/Blue]

#[Blue]End[/Blue] [Blue]Region[/Blue]


  [Blue]Private[/Blue] ht [Blue]As[/Blue] [Blue]New[/Blue] Hashtable
  [Blue]Private[/Blue] Lines() [Blue]As[/Blue] [Blue]String[/Blue]
  [Blue]Private[/Blue] Words() [Blue]As[/Blue] [Blue]String[/Blue]
  [Blue]Private[/Blue] Quote [Blue]As[/Blue] [Blue]String[/Blue] = """"
  [Blue]Private[/Blue] Comment [Blue]As[/Blue] [Blue]String[/Blue] = ""

  [Blue]Private[/Blue] QuoteActive [Blue]As[/Blue] [Blue]Boolean[/Blue] = [Blue]False[/Blue]
  [Blue]Private[/Blue] CommentActive [Blue]As[/Blue] [Blue]Boolean[/Blue] = [Blue]False[/Blue]

  [Blue]Private[/Blue] rx [Blue]As[/Blue] [Blue]New[/Blue] System.Text.RegularExpressions.Regex("(\w{1,})|([\(\.\)"" ])|(.)")

  [Blue]Private[/Blue] [Blue]Sub[/Blue] btnLoadTable_Click([Blue]ByVal[/Blue] sender [Blue]As[/Blue] System.Object, [Blue]ByVal[/Blue] e [Blue]As[/Blue] System.EventArgs) [Blue]Handles[/Blue] btnLoadTable.Click

    [Green]'This list just includes the words in the program so far[/Green]
    ht.Clear()
    ht.Add("Dim", "Blue")
    ht.Add("As", "Blue")
    ht.Add("Sub", "Blue")
    ht.Add("Function", "Blue")
    ht.Add("End", "Blue")
    ht.Add("Private", "Blue")
    ht.Add("New", "Blue")
    ht.Add("While", "Blue")
    ht.Add("If", "Blue")
    ht.Add("Then", "Blue")
    ht.Add("Else", "Blue")
    ht.Add("For", "Blue")
    ht.Add("Next", "Blue")
    ht.Add("To", "Blue")
    ht.Add("ByVal", "Blue")
    ht.Add("Handles", "Blue")
    ht.Add("Return", "Blue")
    ht.Add("String", "Blue")
    ht.Add("Integer", "Blue")
    ht.Add("Boolean", "Blue")
    ht.Add("False", "Blue")
    ht.Add("True", "Blue")
    ht.Add("MyBase", "Blue")
    ht.Add("Protected", "Blue")
    ht.Add("Overrides", "Blue")
    ht.Add("Friend", "Blue")
    ht.Add("Overloads", "Blue")
    ht.Add("Is", "Blue")
    ht.Add("Nothing", "Blue")
    ht.Add("Me", "Blue")
    ht.Add("Class", "Blue")
    ht.Add("Public", "Blue")
    ht.Add("Inherits", "Blue")
    ht.Add("Region", "Blue")
    ht.Add("#Region", "Blue")
    ht.Add("#End", "Blue")
    ht.Add("Exit", "Blue")

  [Blue]End[/Blue] [Blue]Sub[/Blue]

  [Blue]Private[/Blue] [Blue]Function[/Blue] GetCodedString([Blue]ByVal[/Blue] w [Blue]As[/Blue] [Blue]String[/Blue], [Blue]ByVal[/Blue] value [Blue]As[/Blue] [Blue]String[/Blue]) [Blue]As[/Blue] [Blue]String[/Blue]

    [Green]'#Region and #End Region are special cases so handle it separately[/Green]
    [Blue]If[/Blue] w = "#Region" Or w = "#End" [Blue]Then[/Blue]
      [Blue]Return[/Blue] "#[" + value + "]" + w.Substring(1) + "[/" + value + "]"
    [Blue]Else[/Blue]
      [Blue]Return[/Blue] "[" + value + "]" + w + "[/" + value + "]"
    [Blue]End[/Blue] [Blue]If[/Blue]

  [Blue]End[/Blue] [Blue]Function[/Blue]

  [Blue]Private[/Blue] [Blue]Sub[/Blue] btnInsertCodes_Click([Blue]ByVal[/Blue] sender [Blue]As[/Blue] System.Object, [Blue]ByVal[/Blue] e [Blue]As[/Blue] System.EventArgs) [Blue]Handles[/Blue] btnInsertCodes.Click

    TextBox2.Text = "[Code]"
    [Blue]If[/Blue] TextBox1.Text.Length = 0 [Blue]Then[/Blue] [Blue]Exit[/Blue] [Blue]Sub[/Blue] [Green]'Get out if no text[/Green]
    TextBox1.Text = TextBox1.Text.Trim
    [Green]'Clean up the string[/Green]
    [Blue]Dim[/Blue] s [Blue]As[/Blue] [Blue]String[/Blue] = TextBox1.Text.Replace(vbLf, "")
    Lines = s.Split(vbCr.ToCharArray)
    [Blue]For[/Blue] a [Blue]As[/Blue] [Blue]Integer[/Blue] = 0 [Blue]To[/Blue] Lines.Length - 1
      [Blue]Dim[/Blue] mc [Blue]As[/Blue] System.Text.RegularExpressions.MatchCollection = rx.Matches(Lines(a))
        [Blue]For[/Blue] b [Blue]As[/Blue] [Blue]Integer[/Blue] = 0 [Blue]To[/Blue] mc.Count - 1
          Select Case mc(b).ToString
          Case Quote
            QuoteActive = Not QuoteActive
            TextBox2.Text += mc(b).ToString
          Case Comment
            [Blue]If[/Blue] Not QuoteActive [Blue]Then[/Blue]
              TextBox2.Text += "[Green]"
              TextBox2.Text += mc(b).ToString
              CommentActive = [Blue]True[/Blue]    [Green]'No need to check, just set it[/Green]
            [Blue]End[/Blue] [Blue]If[/Blue]
          Case [Blue]Else[/Blue]
            [Blue]If[/Blue] QuoteActive [Blue]Then[/Blue]
              TextBox2.Text += mc(b).ToString
            [Blue]Else[/Blue]
              [Blue]If[/Blue] CommentActive [Blue]Then[/Blue]
                TextBox2.Text += mc(b).ToString
              [Blue]Else[/Blue]
                [Blue]If[/Blue] ht.ContainsKey(mc(b).ToString) [Blue]Then[/Blue]
                  TextBox2.Text += GetCodedString(mc(b).ToString, ht.Item(mc(b).ToString).ToString)
                [Blue]Else[/Blue]
                  TextBox2.Text += mc(b).ToString
                [Blue]End[/Blue] [Blue]If[/Blue]
              [Blue]End[/Blue] [Blue]If[/Blue]
            [Blue]End[/Blue] [Blue]If[/Blue]
        [Blue]End[/Blue] Select
      [Blue]Next[/Blue]
      [Blue]If[/Blue] QuoteActive [Blue]Then[/Blue] QuoteActive = [Blue]False[/Blue]
      [Blue]If[/Blue] CommentActive [Blue]Then[/Blue]
        CommentActive = [Blue]False[/Blue]
        TextBox2.Text += "[ignore][/Green][/ignore]"
      [Blue]End[/Blue] [Blue]If[/Blue]
      TextBox2.Text += Environment.NewLine
    [Blue]Next[/Blue]
    TextBox2.Text += "[ignore]
[/ignore]"

[Blue]End[/Blue] [Blue]Sub[/Blue]
[Blue]End[/Blue] [Blue]Class[/Blue]
[/Code]

[vampire][bat]
 
This is what I got.
It's made in 2005.

Code:
[Blue]Public[/Blue] [Blue]Class[/Blue] TGMLCreator 
 
    [Blue]Private[/Blue] [Blue]Sub[/Blue] TGMLEditor_Load(ByVal sender [Blue]As[/Blue] System.Object, [Blue]ByVal[/Blue] e [Blue]As[/Blue] System.EventArgs) [Blue]Handles[/Blue] MyBase.Load 
 
    [Blue]End[/Blue] [Blue]Sub[/Blue] 
 
    [Blue]Private[/Blue] [Blue]Sub[/Blue] TextBox1_TextChanged(ByVal sender [Blue]As[/Blue] System.Object, [Blue]ByVal[/Blue] e [Blue]As[/Blue] System.EventArgs) [Blue]Handles[/Blue] TextBox1.TextChanged 
        [Blue]Dim[/Blue] objtgmlcode [Blue]As[/Blue] [Blue]New[/Blue] TGMLCode(TextBox1.Text) 
        TextBox2.Text = objtgmlcode.TGMLCode 
        objtgmlcode.ToClipboard() 
    [Blue]End[/Blue] [Blue]Sub[/Blue] 
 
    [Blue]Public[/Blue] [Blue]Sub[/Blue] New() 
 
        [Green]' This call is required by the Windows Form Designer. [/Green]
        InitializeComponent() 
 
        [Green]' Add any initialization after the InitializeComponent() call. [/Green]
 
    [Blue]End[/Blue] [Blue]Sub[/Blue] 
[Blue]End[/Blue] [Blue]Class[/Blue]

Code:
[Blue]Public[/Blue] [Blue]Class[/Blue] TGMLCode 
    [Blue]Private[/Blue] strCode [Blue]As[/Blue] [Blue]String[/Blue] 
    [Blue]Private[/Blue] strTGMLCode [Blue]As[/Blue] [Blue]String[/Blue] 
    [Blue]Private[/Blue] objTGMLTags [Blue]As[/Blue] [Blue]New[/Blue] TGMLTags 
 
    [Blue]Public[/Blue] Property Code() [Blue]As[/Blue] [Blue]String[/Blue] 
        Get 
            [Blue]Return[/Blue] strCode 
        [Blue]End[/Blue] Get 
        Set(ByVal value [Blue]As[/Blue] String) 
            strCode = value 
        [Blue]End[/Blue] Set 
    [Blue]End[/Blue] Property 
 
    [Blue]Public[/Blue] Property TGMLCode() [Blue]As[/Blue] [Blue]String[/Blue] 
        Get 
            MakeTGML() 
            [Blue]Return[/Blue] strTGMLCode 
        [Blue]End[/Blue] Get 
        Set(ByVal value [Blue]As[/Blue] String) 
            strTGMLCode = value 
        [Blue]End[/Blue] Set 
    [Blue]End[/Blue] Property 
 
    [Blue]Public[/Blue] [Blue]Sub[/Blue] New(ByVal Code [Blue]As[/Blue] String) 
        strCode = Code 
    [Blue]End[/Blue] [Blue]Sub[/Blue] 
 
    [Blue]Private[/Blue] [Blue]Sub[/Blue] MakeTGML() 
        [Blue]If[/Blue] strCode.Length = 0 [Blue]Then[/Blue] 
            [Green]'Get out if no text [/Green]
            strTGMLCode = [Red]"" [/Red]
            [Blue]Exit[/Blue] [Blue]Sub[/Blue] 
        [Blue]End[/Blue] [Blue]If[/Blue] 
 
        strCode = strCode.Trim 
        [Green]'Clean up the string  [/Green]
        [Blue]Dim[/Blue] s [Blue]As[/Blue] [Blue]String[/Blue] = strCode.Replace(vbLf, [Red]"") [/Red]
        [Blue]Dim[/Blue] Lines [Blue]As[/Blue] String() 
        [Blue]Dim[/Blue] Words() [Blue]As[/Blue] [Blue]String[/Blue] 
        [Blue]Dim[/Blue] Quote [Blue]As[/Blue] [Blue]String[/Blue] = [Red]"""" [/Red]
        [Blue]Dim[/Blue] Comment [Blue]As[/Blue] [Blue]String[/Blue] = [Red]"'" [/Red]
        [Blue]Dim[/Blue] objTGMLTag [Blue]As[/Blue] TGMLTag 
 
        [Blue]Dim[/Blue] QuoteActive [Blue]As[/Blue] [Blue]Boolean[/Blue] = [Blue]False[/Blue] 
        [Blue]Dim[/Blue] CommentActive [Blue]As[/Blue] [Blue]Boolean[/Blue] = [Blue]False[/Blue] 
 
        Lines = s.Split(vbCr.ToCharArray) 
        strTGMLCode += [Red]"[Code]" [/Red]+ ControlChars.CrLf 
        [Blue]For[/Blue] a [Blue]As[/Blue] [Blue]Integer[/Blue] = 0 [Blue]To[/Blue] Lines.Length - 1 
            Words = Lines(a).Split(" [Red]"c) 
            For b As Integer = 0 To Words.Length - 1 
                If QuoteActive Then 
                    strTGMLCode += Words(b) + " [/Red][Red]" [/Red]
                    [Blue]If[/Blue] Words(b).EndsWith(Quote) [Blue]Then[/Blue] 
                        strTGMLCode += [Red]"[/" [/Red]+ objTGMLTags.QuoteTag.ColorName + [Red]"]" [/Red]
                        QuoteActive = [Blue]False[/Blue] 
                    [Blue]End[/Blue] [Blue]If[/Blue] 
                [Blue]Else[/Blue] 
                    [Blue]If[/Blue] Words(b).StartsWith(Quote) Or Words(b).StartsWith("(" + Quote) [Blue]Then[/Blue] 
                        strTGMLCode += [Red]"[" [/Red]+ objTGMLTags.QuoteTag.ColorName + [Red]"]" [/Red]+ Words(b) + [Red]" [/Red][Red]" [/Red]
                        [Blue]If[/Blue] Not (Words(b).EndsWith(Quote) Or Words(b).EndsWith(Quote + [Red]")")) Then 
                            QuoteActive = True 
                        Else 
                            strTGMLCode += "[/" [/Red]+ objTGMLTags.QuoteTag.ColorName + [Red]"]" [/Red]
                            QuoteActive = [Blue]False[/Blue] 
                        [Blue]End[/Blue] [Blue]If[/Blue] 
                    [Blue]Else[/Blue] 
                        [Blue]If[/Blue] CommentActive [Blue]Then[/Blue] 
                            strTGMLCode += Words(b) + [Red]" [/Red][Red]" [/Red]
                        [Blue]Else[/Blue] 
                            [Blue]If[/Blue] Words(b).StartsWith(Comment) [Blue]Then[/Blue] 
                                CommentActive = [Blue]True[/Blue] 
                                strTGMLCode += [Red]"[" [/Red]+ objTGMLTags.CommentTag.ColorName + [Red]"]" [/Red]+ Words(b) + [Red]" [/Red][Red]" [/Red]
                            [Blue]Else[/Blue] 
                                objTGMLTag = objTGMLTags.ContainsTag(Words(b)) 
                                [Blue]If[/Blue] Not objTGMLTag [Blue]Is[/Blue] [Blue]Nothing[/Blue] [Blue]Then[/Blue] 
                                    strTGMLCode += GetCodedString(Words(b), objTGMLTag.ColorName) 
                                [Blue]Else[/Blue] 
                                    strTGMLCode += Words(b) + [Red]" [/Red][Red]" [/Red]
                                [Blue]End[/Blue] [Blue]If[/Blue] 
                            [Blue]End[/Blue] [Blue]If[/Blue] 
                        [Blue]End[/Blue] [Blue]If[/Blue] 
                    [Blue]End[/Blue] [Blue]If[/Blue] 
                [Blue]End[/Blue] [Blue]If[/Blue] 
            [Blue]Next[/Blue] 
            [Blue]If[/Blue] CommentActive [Blue]Then[/Blue] 
                strTGMLCode += [Red]"[/" [/Red]+ objTGMLTags.CommentTag.ColorName + [Red]"]" [/Red]
                CommentActive = [Blue]False[/Blue] 
            [Blue]End[/Blue] [Blue]If[/Blue] 
            strTGMLCode += Environment.NewLine 
        [Blue]Next[/Blue] 
        strTGMLCode += ControlChars.CrLf + [Red]"
" [/Red]
[Blue]End[/Blue] [Blue]Sub[/Blue]

[Blue]Private[/Blue] [Blue]Function[/Blue] GetCodedString(ByVal w [Blue]As[/Blue] String, [Blue]ByVal[/Blue] value [Blue]As[/Blue] String) [Blue]As[/Blue] [Blue]String[/Blue]
[Green]'#Region and #End Region are special cases so handle it separately [/Green]
[Blue]If[/Blue] w = [Red]"#Region" [/Red]Or w = [Red]"#End" [/Red][Blue]Then[/Blue]
[Blue]Return[/Blue] [Red]"#[" [/Red]+ value + [Red]"]" [/Red]+ w.Substring(1) + [Red]"[/" [/Red]+ value + [Red]"] " [/Red]
[Blue]Else[/Blue]
[Blue]Return[/Blue] [Red]"[" [/Red]+ value + [Red]"]" [/Red]+ w + [Red]"[/" [/Red]+ value + [Red]"] " [/Red]
[Blue]End[/Blue] [Blue]If[/Blue]
[Blue]End[/Blue] [Blue]Function[/Blue]

[Blue]Public[/Blue] [Blue]Sub[/Blue] ToClipboard()
Try
System.Windows.Forms.Clipboard.SetDataObject(strTGMLCode)
Catch ex [Blue]As[/Blue] Exception
[Green]'darn [/Green]
[Blue]End[/Blue] Try
[Blue]End[/Blue] [Blue]Sub[/Blue]
[Blue]End[/Blue] [Blue]Class[/Blue]

[/Code]

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
continued

Code:
[Blue]Public[/Blue] [Blue]Class[/Blue] TGMLTag 
    [Blue]Private[/Blue] strName [Blue]As[/Blue] [Blue]String[/Blue] 
    [Blue]Private[/Blue] colColor [Blue]As[/Blue] TGMLTags.TGMLColors 
    [Blue]Private[/Blue] bolNoTag [Blue]As[/Blue] [Blue]Boolean[/Blue] 
 
    [Blue]Public[/Blue] Property Name() [Blue]As[/Blue] [Blue]String[/Blue] 
        Get 
            [Blue]Return[/Blue] strName 
        [Blue]End[/Blue] Get 
        Set(ByVal value [Blue]As[/Blue] String) 
            strName = value 
        [Blue]End[/Blue] Set 
    [Blue]End[/Blue] Property 
 
    [Blue]Public[/Blue] Property Color() [Blue]As[/Blue] TGMLTags.TGMLColors 
        Get 
            [Blue]Return[/Blue] colColor 
        [Blue]End[/Blue] Get 
        Set(ByVal value [Blue]As[/Blue] TGMLTags.TGMLColors) 
            colColor = value 
        [Blue]End[/Blue] Set 
    [Blue]End[/Blue] Property 
 
    [Blue]Public[/Blue] ReadOnly Property ColorName() [Blue]As[/Blue] [Blue]String[/Blue] 
        Get 
            [Blue]Return[/Blue] System.Enum.GetName(GetType(TGMLTags.TGMLColors), colColor) 
        [Blue]End[/Blue] Get 
    [Blue]End[/Blue] Property 
 
    [Blue]Public[/Blue] Property NoTag() [Blue]As[/Blue] [Blue]Boolean[/Blue] 
        Get 
            [Blue]Return[/Blue] bolNoTag 
        [Blue]End[/Blue] Get 
        Set(ByVal value [Blue]As[/Blue] Boolean) 
            bolNoTag = value 
        [Blue]End[/Blue] Set 
    [Blue]End[/Blue] Property 
 
    [Blue]Public[/Blue] [Blue]Sub[/Blue] New(ByVal Name [Blue]As[/Blue] String, [Blue]ByVal[/Blue] Color [Blue]As[/Blue] TGMLTags.TGMLColors, [Blue]ByVal[/Blue] Notag [Blue]As[/Blue] Boolean) 
        strName = Name 
        colColor = Color 
        bolNoTag = Notag 
    [Blue]End[/Blue] [Blue]Sub[/Blue] 
 
    [Blue]Public[/Blue] [Blue]Sub[/Blue] New(ByVal Name [Blue]As[/Blue] String, [Blue]ByVal[/Blue] Color [Blue]As[/Blue] TGMLTags.TGMLColors) 
        strName = Name 
        colColor = Color 
        bolNoTag = [Blue]False[/Blue] 
    [Blue]End[/Blue] [Blue]Sub[/Blue] 
 
[Blue]End[/Blue] [Blue]Class[/Blue]

Code:
[Blue]Public[/Blue] [Blue]Class[/Blue] TGMLTags 
    [Blue]Private[/Blue] objTags [Blue]As[/Blue] [Blue]New[/Blue] Collection 
 
    [Blue]Public[/Blue] ReadOnly Property CommentTag() [Blue]As[/Blue] TGMLTag 
        Get 
            [Blue]Return[/Blue] GetTag("Comment") 
        [Blue]End[/Blue] Get 
    [Blue]End[/Blue] Property 
 
    [Blue]Public[/Blue] ReadOnly Property QuoteTag() [Blue]As[/Blue] TGMLTag 
        Get 
            [Blue]Return[/Blue] GetTag("Quote") 
        [Blue]End[/Blue] Get 
    [Blue]End[/Blue] Property 
 
    [Blue]Public[/Blue] [Blue]Sub[/Blue] New() 
        LoadTable() 
    [Blue]End[/Blue] [Blue]Sub[/Blue] 
 
    [Blue]Public[/Blue] [Blue]Function[/Blue] Item(ByVal Index [Blue]As[/Blue] Integer) [Blue]As[/Blue] TGMLTag 
        [Blue]Return[/Blue] objTags(index) 
    [Blue]End[/Blue] [Blue]Function[/Blue] 
 
    [Blue]Public[/Blue] [Blue]Function[/Blue] ContainsTag(ByVal Tag [Blue]As[/Blue] String) [Blue]As[/Blue] TGMLTag 
        [Blue]Dim[/Blue] tempTag [Blue]As[/Blue] TGMLTag = GetTag(Tag) 
        [Blue]If[/Blue] tempTag [Blue]Is[/Blue] [Blue]Nothing[/Blue] OrElse tempTag.NoTag = [Blue]True[/Blue] [Blue]Then[/Blue] 
            [Blue]Return[/Blue] [Blue]Nothing[/Blue] 
        [Blue]Else[/Blue] 
            [Blue]Return[/Blue] tempTag 
        [Blue]End[/Blue] [Blue]If[/Blue] 
    [Blue]End[/Blue] [Blue]Function[/Blue] 
 
    [Blue]Private[/Blue] [Blue]Function[/Blue] GetTag(ByVal Tag [Blue]As[/Blue] String) [Blue]As[/Blue] TGMLTag 
        [Blue]For[/Blue] inttemp [Blue]As[/Blue] [Blue]Integer[/Blue] = 1 [Blue]To[/Blue] objTags.Count 
            [Blue]If[/Blue] CType(objTags(inttemp), TGMLTag).Name = Tag [Blue]Then[/Blue] 
                [Blue]Return[/Blue] CType(objTags(inttemp), TGMLTag) 
                [Blue]Exit[/Blue] [Blue]Function[/Blue] 
            [Blue]End[/Blue] [Blue]If[/Blue] 
        [Blue]Next[/Blue] 
        [Blue]Return[/Blue] [Blue]Nothing[/Blue] 
    [Blue]End[/Blue] [Blue]Function[/Blue] 
 
    [Blue]Private[/Blue] [Blue]Sub[/Blue] LoadTable() 
        [Green]'This list just includes the words in the program so far  [/Green]
        objTags.Clear() 
        objTags.Add(New TGMLTag("Dim", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("As", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Sub", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Function", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("End", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Private", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("New", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("While", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("If", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Then", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Else", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("For", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Next", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("To", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("ByVal", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Handles", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Return", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("String", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Integer", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Boolean", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("False", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("True", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("MyBase", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Protected", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Overrides", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Friend", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Overloads", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Is", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Nothing", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Me", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Class", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Public", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Inherits", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Region", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("#Region", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("#End", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Exit", TGMLColors.Blue)) 
        objTags.Add(New TGMLTag("Comment", TGMLColors.Green, True)) 
        objTags.Add(New TGMLTag("Quote", TGMLColors.Red, True)) 
    [Blue]End[/Blue] [Blue]Sub[/Blue] 
 
    [Blue]Public[/Blue] Enum TGMLColors 
        Blue 
        Green 
        Red 
        Black 
        White 
    [Blue]End[/Blue] Enum 
[Blue]End[/Blue] [Blue]Class[/Blue]

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Code:
[Blue]Public[/Blue] [Blue]Class[/Blue] TGMLCode 
    [Blue]Private[/Blue] strCode [Blue]As[/Blue] [Blue]String[/Blue] 
    [Blue]Private[/Blue] strTGMLCode [Blue]As[/Blue] [Blue]String[/Blue] 
    [Blue]Private[/Blue] objTGMLTags [Blue]As[/Blue] [Blue]New[/Blue] TGMLTags 
 
    [Blue]Public[/Blue] Property Code() [Blue]As[/Blue] [Blue]String[/Blue] 
        Get 
            [Blue]Return[/Blue] strCode 
        [Blue]End[/Blue] Get 
        Set(ByVal value [Blue]As[/Blue] String) 
            strCode = value 
        [Blue]End[/Blue] Set 
    [Blue]End[/Blue] Property 
 
    [Blue]Public[/Blue] Property TGMLCode() [Blue]As[/Blue] [Blue]String[/Blue] 
        Get 
            [Blue]Return[/Blue] strTGMLCode 
        [Blue]End[/Blue] Get 
        Set(ByVal value [Blue]As[/Blue] String) 
            strTGMLCode = value 
        [Blue]End[/Blue] Set 
    [Blue]End[/Blue] Property 
 
    [Blue]Public[/Blue] [Blue]Sub[/Blue] New(ByVal Code [Blue]As[/Blue] String) 
        strCode = Code 
    [Blue]End[/Blue] [Blue]Sub[/Blue] 
 
    [Blue]Public[/Blue] [Blue]Function[/Blue] MakeTGML() [Blue]As[/Blue] [Blue]String[/Blue] 
        [Blue]If[/Blue] strCode.Length = 0 [Blue]Then[/Blue] 
            [Green]'Get out if no text [/Green]
            strTGMLCode = [Red]""[/Red]
            [Blue]Return[/Blue] [Red]""[/Red]
        [Blue]End[/Blue] [Blue]If[/Blue] 
 
        strCode = strCode.Trim 
        [Green]'Clean up the string  [/Green]
        [Blue]Dim[/Blue] s [Blue]As[/Blue] [Blue]String[/Blue] = strCode.Replace(vbLf, [Red]""[/Red])
        [Blue]Dim[/Blue] Lines [Blue]As[/Blue] String() 
        [Blue]Dim[/Blue] Words() [Blue]As[/Blue] [Blue]String[/Blue] 
        [Blue]Dim[/Blue] Quote [Blue]As[/Blue] [Blue]String[/Blue] = [Red]""[/Red][Red]""[/Red]
        [Blue]Dim[/Blue] Comment [Blue]As[/Blue] [Blue]String[/Blue] = [Red]"'"[/Red]
        [Blue]Dim[/Blue] objTGMLTag [Blue]As[/Blue] TGMLTag 
 
        [Blue]Dim[/Blue] QuoteActive [Blue]As[/Blue] [Blue]Boolean[/Blue] = [Blue]False[/Blue] 
        [Blue]Dim[/Blue] CommentActive [Blue]As[/Blue] [Blue]Boolean[/Blue] = [Blue]False[/Blue] 
 
        Lines = s.Split(vbCr.ToCharArray) 
        [Blue]For[/Blue] a [Blue]As[/Blue] [Blue]Integer[/Blue] = 0 [Blue]To[/Blue] Lines.Length - 1 
            Words = Lines(a).Split([Red]""[/Red]c)
            [Blue]For[/Blue] b [Blue]As[/Blue] [Blue]Integer[/Blue] = 0 [Blue]To[/Blue] Words.Length - 1 
                [Blue]If[/Blue] Words(b).Contains(Quote) [Blue]Then[/Blue] 
                    [Blue]For[/Blue] inttemp [Blue]As[/Blue] [Blue]Integer[/Blue] = 0 [Blue]To[/Blue] Words(b).Length - 1 
                        [Blue]If[/Blue] Words(b).Substring(inttemp, 1) = Quote AndAlso Not QuoteActive [Blue]Then[/Blue] 
                            strTGMLCode += [Red]"["[/Red]+ objTGMLTags.QuoteTag.ColorName + [Red]"]"[/Red]+ Words(b).Substring(inttemp, 1) 
                            QuoteActive = [Blue]True[/Blue] 
                        ElseIf Words(b).Substring(inttemp, 1) = Quote AndAlso QuoteActive [Blue]Then[/Blue] 
                            strTGMLCode += Words(b).Substring(inttemp, 1) + [Red]"[/"[/Red]+ objTGMLTags.QuoteTag.ColorName + [Red]"]"[/Red]
                            QuoteActive = [Blue]False[/Blue] 
                        [Blue]Else[/Blue] 
                            strTGMLCode += Words(b).Substring(inttemp, 1) 
                        [Blue]End[/Blue] [Blue]If[/Blue] 
                    [Blue]Next[/Blue] 
                [Blue]Else[/Blue] 
                    [Blue]If[/Blue] CommentActive [Blue]Then[/Blue] 
                        strTGMLCode += Words(b) + [Red]""[/Red]
                    [Blue]Else[/Blue] 
                        [Blue]If[/Blue] Words(b).StartsWith(Comment) [Blue]Then[/Blue] 
                            CommentActive = [Blue]True[/Blue] 
                            strTGMLCode += [Red]"["[/Red]+ objTGMLTags.CommentTag.ColorName + [Red]"]"[/Red]+ Words(b) + [Red]""[/Red]
                        [Blue]Else[/Blue] 
                            objTGMLTag = objTGMLTags.ContainsTag(Words(b)) 
                            [Blue]If[/Blue] Not objTGMLTag [Blue]Is[/Blue] [Blue]Nothing[/Blue] [Blue]Then[/Blue] 
                                strTGMLCode += GetCodedString(Words(b), objTGMLTag.ColorName) 
                            [Blue]Else[/Blue] 
                                strTGMLCode += Words(b) + [Red]""[/Red]
                            [Blue]End[/Blue] [Blue]If[/Blue] 
                        [Blue]End[/Blue] [Blue]If[/Blue] 
                    [Blue]End[/Blue] [Blue]If[/Blue] 
                [Blue]End[/Blue] [Blue]If[/Blue] 
            [Blue]Next[/Blue] 
            [Blue]If[/Blue] CommentActive [Blue]Then[/Blue] 
                strTGMLCode += [Red]"[/"[/Red]+ objTGMLTags.CommentTag.ColorName + [Red]"]"[/Red]
                CommentActive = [Blue]False[/Blue] 
            [Blue]End[/Blue] [Blue]If[/Blue] 
            strTGMLCode += Environment.NewLine 
        [Blue]Next[/Blue] 
        strTGMLCode = [Red]"[ignore][Code][/ignore]"[/Red]+ ControlChars.CrLf + strTGMLCode.Replace([Red]"[ignore][Code][/ignore]"[/Red],[Red]"[ignore][ignore][Code][/ignore][/ignore]"[/Red]).Replace([Red]"[ignore]
[/ignore]"[/Red],[Red]"[ignore][ignore][/Code][/ignore][/ignore]"[/Red])+ [Red]"[ignore][/Code][/ignore]"[/Red]
[Blue]Return[/Blue] strTGMLCode
[Blue]End[/Blue] [Blue]Function[/Blue]

[Blue]Private[/Blue] [Blue]Function[/Blue] GetCodedString(ByVal w [Blue]As[/Blue] String, [Blue]ByVal[/Blue] value [Blue]As[/Blue] String) [Blue]As[/Blue] [Blue]String[/Blue]
[Green]'#Region and #End Region are special cases so handle it separately [/Green]
[Blue]If[/Blue] w = [Red]"#Region"[/Red]Or w = [Red]"#End"[/Red][Blue]Then[/Blue]
[Blue]Return[/Blue] [Red]"#["[/Red]+ value + [Red]"]"[/Red]+ w.Substring(1) + [Red]"[/"[/Red]+ value + [Red]"]"[/Red]
[Blue]Else[/Blue]
[Blue]Return[/Blue] [Red]"["[/Red]+ value + [Red]"]"[/Red]+ w + [Red]"[/"[/Red]+ value + [Red]"]"[/Red]
[Blue]End[/Blue] [Blue]If[/Blue]
[Blue]End[/Blue] [Blue]Function[/Blue]

[Blue]Public[/Blue] [Blue]Sub[/Blue] ToClipboard()
Try
System.Windows.Forms.Clipboard.SetDataObject(strTGMLCode)
Catch ex [Blue]As[/Blue] Exception
[Green]'darn [/Green]
[Blue]End[/Blue] Try
[Blue]End[/Blue] [Blue]Sub[/Blue]
[Blue]End[/Blue] [Blue]Class[/Blue]
[/Code]

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Sorry about that I was supposed to click on preview post.

But anyway it works.

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
chrissie, I like the class structure.

My intention was to convert it to a control and link it in with Zameer's project.

One thing, though. Yours suffers from the same problem that my manual parsing did i.e. it doesn't handle text like:

SubName(ByVal ...
... As Boolean)

etc., which the RegEx version does.

I hope to post another version later tonight.



[vampire][bat]
 
Excellent, chrissie.

That just leaves two things as far as I can see.

1)
[blue]MyBase.New[/blue] should be [blue]MyBase[/blue].New, which I think basically means that after a dot, colour coding should be switched off - but I've not yet thoroughly checked that.

2)
Linking in with Zameer's project.

Unfortuately I've not had chance to do anything more today - unexpected visitors.

But your version is definitely starworthy.


[vampire][bat]
 
I've not had chance to do much today, but this is a start on a control:

Code:
[Blue]Public[/Blue] [Blue]Class[/Blue] TGMLRichTextBox
  [Blue]Inherits[/Blue] System.Windows.Forms.RichTextBox

#[Blue]Region[/Blue] [Red]" Windows Form Designer generated code "[/Red]

    [Blue]Public[/Blue] [Blue]Sub[/Blue] [Blue]New[/Blue]()
        [Blue]MyBase[/Blue].[Blue]New[/Blue]()

        [Green]'This call is required by the Windows Form Designer.[/Green]
        InitializeComponent()

        [Green]'Add any initialization after the InitializeComponent() call[/Green]

    [Blue]End[/Blue] [Blue]Sub[/Blue]

    [Green]'UserControl overrides dispose to clean up the component list.[/Green]
    [Blue]Protected[/Blue] [Blue]Overloads[/Blue] [Blue]Overrides[/Blue] [Blue]Sub[/Blue] Dispose([Blue]ByVal[/Blue] disposing [Blue]As[/Blue] [Blue]Boolean[/Blue])
        [Blue]If[/Blue] disposing [Blue]Then[/Blue]
            [Blue]If[/Blue] Not (components [Blue]Is[/Blue] [Blue]Nothing[/Blue]) [Blue]Then[/Blue]
                components.Dispose()
            [Blue]End[/Blue] [Blue]If[/Blue]
        [Blue]End[/Blue] [Blue]If[/Blue]
        [Blue]MyBase[/Blue].Dispose(disposing)
    [Blue]End[/Blue] [Blue]Sub[/Blue]

    [Green]'Required by the Windows Form Designer[/Green]
    [Blue]Private[/Blue] components [Blue]As[/Blue] System.ComponentModel.IContainer

    [Green]'NOTE: The following procedure is required by the Windows Form Designer[/Green]
    [Green]'It can be modified using the Windows Form Designer.  [/Green]
    [Green]'Do not modify it using the code editor.[/Green]
    <System.Diagnostics.DebuggerStepThrough()> [Blue]Private[/Blue] [Blue]Sub[/Blue] InitializeComponent()
        components = [Blue]New[/Blue] System.ComponentModel.Container()
    [Blue]End[/Blue] [Blue]Sub[/Blue]

#[Blue]End[/Blue] [Blue]Region[/Blue]

#[Blue]Region[/Blue] [Red]"Local Variables"[/Red]

  [Blue]Friend[/Blue] WithEvents TGMLListBox [Blue]As[/Blue] ListBox

  [Blue]Private[/Blue] CurrentPosition [Blue]As[/Blue] [Blue]Integer[/Blue] = 0
  [Blue]Private[/Blue] SearchString [Blue]As[/Blue] [Blue]String[/Blue] = [Red]""[/Red]

#[Blue]End[/Blue] [Blue]Region[/Blue]

#[Blue]Region[/Blue] [Red]"Properties"[/Red]

  [Blue]Private[/Blue] FActivateOnRightClick [Blue]As[/Blue] [Blue]Boolean[/Blue]
  [Blue]Private[/Blue] FActivateOnChar() [Blue]As[/Blue] Char

  [Blue]Public[/Blue] Property ActivateOnRightClick() [Blue]As[/Blue] [Blue]Boolean[/Blue]
    Get
      [Blue]Return[/Blue] FActivateOnRightClick
    [Blue]End[/Blue] Get
    Set([Blue]ByVal[/Blue] Value [Blue]As[/Blue] [Blue]Boolean[/Blue])
      FActivateOnRightClick = Value
    [Blue]End[/Blue] Set
  [Blue]End[/Blue] Property

  <System.ComponentModel.Browsable([Blue]False[/Blue])> _
  [Blue]Public[/Blue] Property ActivateOnChar() [Blue]As[/Blue] Char()
    Get
      [Blue]Return[/Blue] FActivateOnChar
    [Blue]End[/Blue] Get
    Set([Blue]ByVal[/Blue] Value [Blue]As[/Blue] Char())
      FActivateOnChar = Value
    [Blue]End[/Blue] Set
  [Blue]End[/Blue] Property

#[Blue]End[/Blue] [Blue]Region[/Blue]

  [Blue]Public[/Blue] [Blue]Function[/Blue] ProcessTGML() [Blue]As[/Blue] [Blue]String[/Blue]

  [Blue]End[/Blue] [Blue]Function[/Blue]

  [Blue]Private[/Blue] [Blue]Sub[/Blue] DisplayListBox([Blue]ByVal[/Blue] CurPoint [Blue]As[/Blue] Point)

    TGMLListBox = [Blue]New[/Blue] ListBox
    With TGMLListBox
      .BorderStyle = BorderStyle.FixedSingle
      .Items.Add([Red]"Item1"[/Red])
      .Items.Add([Red]"Item2"[/Red])
      .Cursor = Cursors.Arrow
      CurrentPosition = [Blue]Me[/Blue].SelectionStart
      SearchString = [Red]""[/Red]
      CurPoint.Y += [Blue]Me[/Blue].SelectionFont.Height
      [Blue]If[/Blue] CurPoint.X < 0 [Blue]Then[/Blue] CurPoint.X = 5
      [Blue]If[/Blue] CurPoint.Y < 0 [Blue]Then[/Blue] CurPoint.Y = 5
      [Blue]If[/Blue] CurPoint.X + .Width > ([Blue]Me[/Blue].Right - 5) [Blue]Then[/Blue] CurPoint.X = [Blue]Me[/Blue].Right - (.Width + 10)
      [Blue]If[/Blue] CurPoint.Y + .Height > ([Blue]Me[/Blue].Bottom - 5) [Blue]Then[/Blue] CurPoint.Y = [Blue]Me[/Blue].Bottom - (.Height + 30)
      .Location = CurPoint
      .Visible = [Blue]True[/Blue]
      .BringToFront()
      [Blue]Me[/Blue].Controls.Add(TGMLListBox)
      .BringToFront()
      .Focus()
    [Blue]End[/Blue] With

  [Blue]End[/Blue] [Blue]Sub[/Blue]

  [Blue]Private[/Blue] [Blue]Sub[/Blue] TGMLRichTextBox_MouseUp([Blue]ByVal[/Blue] sender [Blue]As[/Blue] Object, [Blue]ByVal[/Blue] e [Blue]As[/Blue] System.Windows.Forms.MouseEventArgs) [Blue]Handles[/Blue] [Blue]MyBase[/Blue].MouseUp

    [Blue]If[/Blue] e.Button = MouseButtons.Right [Blue]Then[/Blue]
      [Blue]If[/Blue] FActivateOnRightClick [Blue]Then[/Blue]
        DisplayListBox([Blue]New[/Blue] Point(e.X, e.Y - ([Blue]Me[/Blue].Top)))
      [Blue]End[/Blue] [Blue]If[/Blue]
    [Blue]End[/Blue] [Blue]If[/Blue]

  [Blue]End[/Blue] [Blue]Sub[/Blue]

  [Blue]Private[/Blue] [Blue]Sub[/Blue] TGMLRichTextBox_KeyPress([Blue]ByVal[/Blue] sender [Blue]As[/Blue] Object, [Blue]ByVal[/Blue] e [Blue]As[/Blue] System.Windows.Forms.KeyPressEventArgs) [Blue]Handles[/Blue] [Blue]MyBase[/Blue].KeyPress

    [Blue]If[/Blue] ActivateOnChar.Length > 0 [Blue]Then[/Blue]
      [Blue]For[/Blue] a [Blue]As[/Blue] [Blue]Integer[/Blue] = 0 [Blue]To[/Blue] ActivateOnChar.Length - 1
        [Blue]If[/Blue] e.KeyChar = ActivateOnChar(a) [Blue]Then[/Blue]
          DisplayListBox([Blue]Me[/Blue].GetPositionFromCharIndex([Blue]Me[/Blue].SelectionStart))
          [Blue]Exit[/Blue] [Blue]For[/Blue]
        [Blue]End[/Blue] [Blue]If[/Blue]
      [Blue]Next[/Blue]
    [Blue]End[/Blue] [Blue]If[/Blue]

  [Blue]End[/Blue] [Blue]Sub[/Blue]

  [Blue]Private[/Blue] [Blue]Sub[/Blue] TGMLListBox_Click([Blue]ByVal[/Blue] sender [Blue]As[/Blue] Object, [Blue]ByVal[/Blue] e [Blue]As[/Blue] System.EventArgs) [Blue]Handles[/Blue] TGMLListBox.Click

    [Blue]Me[/Blue].Controls.Remove(TGMLListBox)
    TGMLListBox = [Blue]Nothing[/Blue]

  [Blue]End[/Blue] [Blue]Sub[/Blue]
[Blue]End[/Blue] [Blue]Class[/Blue]

and in the main form:

Code:
[Blue]Public[/Blue] [Blue]Class[/Blue] TGMLForm
  [Blue]Inherits[/Blue] System.Windows.Forms.Form

#[Blue]Region[/Blue] [Red]" Windows Form Designer generated code "[/Red]

  [Blue]Public[/Blue] [Blue]Sub[/Blue] [Blue]New[/Blue]()
    [Blue]MyBase[/Blue].[Blue]New[/Blue]()

    [Green]'This call is required by the Windows Form Designer.[/Green]
    InitializeComponent()

    [Green]'Add any initialization after the InitializeComponent() call[/Green]

  [Blue]End[/Blue] [Blue]Sub[/Blue]

  [Green]'Form overrides dispose to clean up the component list.[/Green]
  [Blue]Protected[/Blue] [Blue]Overloads[/Blue] [Blue]Overrides[/Blue] [Blue]Sub[/Blue] Dispose([Blue]ByVal[/Blue] disposing [Blue]As[/Blue] [Blue]Boolean[/Blue])
    [Blue]If[/Blue] disposing [Blue]Then[/Blue]
      [Blue]If[/Blue] Not (components [Blue]Is[/Blue] [Blue]Nothing[/Blue]) [Blue]Then[/Blue]
        components.Dispose()
      [Blue]End[/Blue] [Blue]If[/Blue]
    [Blue]End[/Blue] [Blue]If[/Blue]
    [Blue]MyBase[/Blue].Dispose(disposing)
  [Blue]End[/Blue] [Blue]Sub[/Blue]

  [Green]'Required by the Windows Form Designer[/Green]
  [Blue]Private[/Blue] components [Blue]As[/Blue] System.ComponentModel.IContainer

  [Green]'NOTE: The following procedure is required by the Windows Form Designer[/Green]
  [Green]'It can be modified using the Windows Form Designer.  [/Green]
  [Green]'Do not modify it using the code editor.[/Green]
  [Blue]Friend[/Blue] WithEvents TgmlRichTextBox1 [Blue]As[/Blue] TGMLWriter.TGMLRichTextBox
  <System.Diagnostics.DebuggerStepThrough()> [Blue]Private[/Blue] [Blue]Sub[/Blue] InitializeComponent()
    [Blue]Me[/Blue].TgmlRichTextBox1 = [Blue]New[/Blue] TGMLWriter.TGMLRichTextBox
    [Blue]Me[/Blue].SuspendLayout()
    [Green]'[/Green]
    [Green]'TgmlRichTextBox1[/Green]
    [Green]'[/Green]
    [Blue]Me[/Blue].TgmlRichTextBox1.ActivateOnChar = [Blue]Nothing[/Blue]
    [Blue]Me[/Blue].TgmlRichTextBox1.ActivateOnRightClick = [Blue]True[/Blue]
    [Blue]Me[/Blue].TgmlRichTextBox1.Location = [Blue]New[/Blue] System.Drawing.Point(8, 24)
    [Blue]Me[/Blue].TgmlRichTextBox1.Name = [Red]"TgmlRichTextBox1"[/Red]
    [Blue]Me[/Blue].TgmlRichTextBox1.Size = [Blue]New[/Blue] System.Drawing.Size(384, 240)
    [Blue]Me[/Blue].TgmlRichTextBox1.TabIndex = 0
    [Blue]Me[/Blue].TgmlRichTextBox1.Text = [Red]"TgmlRichTextBox1"[/Red]
    [Green]'[/Green]
    [Green]'TGMLForm[/Green]
    [Green]'[/Green]
    [Blue]Me[/Blue].AutoScaleBaseSize = [Blue]New[/Blue] System.Drawing.Size(5, 13)
    [Blue]Me[/Blue].ClientSize = [Blue]New[/Blue] System.Drawing.Size(568, 301)
    [Blue]Me[/Blue].Controls.Add([Blue]Me[/Blue].TgmlRichTextBox1)
    [Blue]Me[/Blue].Name = [Red]"TGMLForm"[/Red]
    [Blue]Me[/Blue].Text = [Red]"Form1"[/Red]
    [Blue]Me[/Blue].ResumeLayout([Blue]False[/Blue])

  [Blue]End[/Blue] [Blue]Sub[/Blue]

#[Blue]End[/Blue] [Blue]Region[/Blue]


  [Blue]Private[/Blue] [Blue]Sub[/Blue] TGMLWriter_Load([Blue]ByVal[/Blue] sender [Blue]As[/Blue] Object, [Blue]ByVal[/Blue] e [Blue]As[/Blue] System.EventArgs) [Blue]Handles[/Blue] [Blue]MyBase[/Blue].Load

    TgmlRichTextBox1.ActivateOnChar = [Red]".["[/Red].ToCharArray

  [Blue]End[/Blue] [Blue]Sub[/Blue]

[Blue]End[/Blue] [Blue]Class[/Blue]

Hopefully during the course of the week I'll be able to get it finished and, when incorporated with chrissie's code should enable a combination of automatic formatting and manual fine-tuning for code and comment posting.

[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top