Shop OBEX P1 Docs P2 Docs Learn Events
Suggestions for 100% Open source development on the Prop? - Page 3 — Parallax Forums

Suggestions for 100% Open source development on the Prop?

13»

Comments

  • jazzedjazzed Posts: 11,803
    edited 2010-12-13 13:19
    Batang wrote: »
    Decompiled is the correct terminology when dealing with .NET.
    Which tool did you use? The latest Reflector does not seem to produce compilable code.
  • BradCBradC Posts: 2,601
    edited 2010-12-13 20:50
    mpark wrote: »
    Brad, would you be willing to share your PropTool-compatible FP conversion algorithm? Either real or pseudo-code. I'd be interested to see what it would take to get Homespun in line. Please start a new thread if you decide to share.

    PM sent.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2010-12-31 00:58
    The simple answer is Eclipse will handle Mac, Linux, and Windows. It would also support Spin, Pasm, SXB & SXasm, Pbasic, PropBasic and their help sections.

    I started using Eclipse after I volunteered to work with a FIRST team. A few mentors ported Microchip’s MPLAB C18 to Eclipse, now the FIRSTies (our future engineers) use the Wind River Workbench subversion of Eclipse. Eclipse plug-ins have been created to support professionals, students and hobbyists for ARM, AVR & Arduino’s, and all MPLAB tool chains. I have seen additional plug-ins available for an enormous variety of languages including versions of Microsoft Assembler and Basic.

    http://www.usfirst.org/default.aspx
    http://www.windriver.com/products/workbench/
    http://avr-eclipse.sourceforge.net/wiki/index.php/The_AVR_Eclipse_Plugin
    http://marketplace.eclipse.org/

    Three of Eclipse’s simple features that I appreciated were the differences in how it handled its file directory compared to Visual Studio 2008. Another was being able to freely make templates of any kind to drop in place where ever I needed it. Dragging and dropping any portion of the workbench and docking it to my second monitor. These are simple features, but they served me well when I took my first C++ course, while the class used Visual Studio.

    By creating a Master IDE with Eclipse, we would be encouraging professionals, students, and other hobbyists that are already using Eclipse to download the Parallax product plug-ins to their familiar IDE; opposed to downloading a different IDE for every Parallax product, sub-language, and customer created tools.

    A support forum could be created to encourage plug-in development. There has been many posts supporting this general idea for some time now, but somebody always has a problem with any possible answer. Despite this, Eclipse is still supported better than any other open source IDE I know of, and it is far more likely that, anybody wanting to tackle such a project would be able to “get up to speed” easier with Eclipse and its mature support base. This is sample of my links on Eclipse, enjoy.

    Improve the usability of your Eclipse-based apps
    http://www.ibm.com/developerworks/opensource/library/os-eclipse-ua/

    PDE Does Plug-ins
    http://www.eclipse.org/articles/Article-PDE-does-plugins/PDE-intro.html

    What to plug into Eclipse, a Universal IDE
    http://www.ibm.com/developerworks/opensource/library/os-ecl-what/index.html

    Developing the Eclipse "Hello World" plug-in
    http://www.eclipse.org/articles/Article-Your%20First%20Plug-in/YourFirstPlugin.html

    Notes on the Eclipse Plug-in Architecture
    http://www.eclipse.org/articles/Article-Plug-in-architecture/plugin_architecture.html

    Plug-in development 101, Part 1: The basics of Eclipse plug-in development.
    http://www.ibm.com/developerworks/opensource/library/os-eclipse-plugindev1/index.html

    Plug-in development 101, Part 2: Learning the basics about plug-in development and rich-client applications
    http://www.ibm.com/developerworks/opensource/library/os-eclipse-plugindev2/index.html

    Workbench User Guide & Platform Plug-in Developer Guide
    http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.help.webapp/advanced/banner.html

    Create an Eclipse-based application using the Graphical Editing Framework
    http://www.ibm.com/developerworks/opensource/library/os-eclipse-gef11/index.html?S_TACT=105AGX44&S_CMP=EDU

    Use Eclipse for debugging your software projects
    http://www.ibm.com/developerworks/opensource/library/os-ecbug/index.html?S_TACT=105AGX44&S_CMP=EDU

    How to write an Eclipse debugger
    http://www.eclipse.org/articles/Article-Debugger/how-to.html

    Build extensions for Eclipse one snippet at a time
    http://www.ibm.com/developerworks/opensource/library/os-eclipse-snippet/index.html?ca=dgr-lnxw16RichEclipse

    Eclipse Community Forums
    http://www.eclipse.org/forums/

    The CDT Project provides a fully functional C and C++ Integrated Development Environment based on the Eclipse platform
    http://www.eclipse.org/cdt/

    Eclipse is a collection of open source projects
    http://www.eclipse.org/projects/

    Create a commercial-quality IDEs that plug into Eclipse IDE, Part 1: The core
    http://www.ibm.com/developerworks/opensource/tutorials/os-ecl-commplgin1/index.html

    Create a commercial-quality IDEs that plug into Eclipse IDE, Part 2: The user interface
    http://www.ibm.com/developerworks/opensource/tutorials/os-ecl-commplgin2/index.html

    Create a commercial-quality IDEs that plug into Eclipse IDE, Part 3: Fine-tune the UI
    http://www.ibm.com/developerworks/opensource/tutorials/os-ecl-commplgin3/index.html

    Building a CDT-based editor, Part 1: The C/C++ Development Tooling model
    http://www.ibm.com/developerworks/opensource/library/os-ecl-cdt1/index.html

    Building a CDT-based editor, Part 2: Highlighting source code with syntax styling
    http://www.ibm.com/developerworks/opensource/library/os-ecl-cdt2/index.html

    Building a CDT-based editor, Part 3: Basic CDT parsing
    http://www.ibm.com/developerworks/opensource/library/os-ecl-cdt3/index.html

    Building a CDT-based editor, Part 4: Advanced CDT parsing and the Persisted Document Object Model
    http://www.ibm.com/developerworks/opensource/library/os-ecl-cdt4/index.html

    Building a CDT-based editor, Part 5: Using the PDOM for code completion
    http://www.ibm.com/developerworks/opensource/library/os-ecl-cdt5/index.html

    Eclipse IDE project resources
    http://www.ibm.com/developerworks/opensource/top-projects/eclipse/index.html

    Developing applications using the Eclipse C/C++ Development Toolkit
    http://www.ibm.com/developerworks/opensource/library/os-eclipse-stlcdt/index.html?S_TACT=105AGX44&S_CMP=EDU

    Interfacing with the CDT debugger, Part 1: Understand the C/C++ debugger interface
    http://www.ibm.com/developerworks/library/os-eclipse-cdt-debug1/index.html?S_TACT=105AGX44&S_CMP=EDU

    Interfacing with the CDT debugger, Part 2: Accessing gdb with the Eclipse CDT and MI
    http://www.ibm.com/developerworks/opensource/library/os-eclipse-cdt-debug2/

    Web page dealing with building the AVR plug-in
    http://avr-eclipse.sourceforge.net/wiki/index.php/Building_the_Plugin

    Simplified Robot Controller Programming with the C18 plug-in
    http://users.wpi.edu/~bamiller/WPILib/

    Using Eclipse IDE & makefile as MPLAB replacement
    http://www.chiefdelphi.com/forums/showthread.php?t=35571

    The classic Eclipse download: the Eclipse Platform, Java Development Tools, and Plug-in Development Environment, including source and both user and programmer documentation
    http://www.eclipse.org/downloads/
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-12-31 07:23
    The simple answer is Eclipse will handle Mac, Linux, and Windows. It would also support Spin, Pasm, SXB & SXasm, Pbasic, PropBasic and their help sections.

    I started using Eclipse after I volunteered to work with a FIRST team. A few mentors ported M

    I've worked a couple of big names that used Eclipse. One thing is, somebody has "be in charge". I vote Capt.Quirk be the leader on this, as he has the most familiarity on how to use it.

    What does Eclipse need? There are an awful lots of links in this post alone, what does a person have to do to get Eclipse set up for use with the prop?
  • YodaYoda Posts: 132
    edited 2010-12-31 16:40
    The simple answer is Eclipse will handle Mac, Linux, and Windows. It would also support Spin, Pasm, SXB & SXasm, Pbasic, PropBasic and their help sections.

    I agree 100% as I said this earlier in this thread. However, it is not as easy as you make it out to be to do this. I have been looking at this for several months and there is a lot of work involved. The first step is really to have a grammar that describes spin and then basically build the compiler first. There are some tools that will help with the plugins, mainly I think IMP will be a good starting point for the IDE.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2010-12-31 22:30
    My personal intentions for Eclipse was to take PropBasic and SXB in their current form as a command line compiler, and create a tool chain to work with Eclipse. Then start customizing all the great features of Eclipse to work with the command line program. I was trying to do so because of my personal need for more IDE tools.

    The Plug-ins for C18 were not very big, and they worked great. I have used the Cheat Sheets in the PDE a few times, and they seem to make the task easy. But I don't understand much of the terminology. That is why I gathered all those links (and those are just a few of them). I need to read more of my links now that I have some spare time again.

    One of the features of Eclipse was to automatically seek and acquire a compiler, so long as it knows it exists.


    Concerning Spin, I know nothing about dll's or api's. Until today I always thought PASM was part of Propellant? Parallax also provides the Basic Stamp Tokenizer. It was my thought that people with real programming experience, and good documentation would know how to integrate them into Eclipse plug-ins or rich-client application.

    (Prof_Braino), The pictures document the Eclipse cheat sheet process for building a plug-in. After downloading the Classic Eclipse, set the workspace to the "Plug In Device" perspective, then->Help Menu->Cheat Sheets :)


    Eclipse Cheat Sheet 1.gif
    Eclipse Cheat Sheet 3.gif
    Eclipse Cheat Sheet 4.gif
    Eclipse Cheat Sheet 5.gif
    Eclipse Cheat Sheet 6.gif
    Eclipse Cheat Sheet 7.gif
    439 x 651 - 33K
    443 x 629 - 39K
    451 x 631 - 33K
    431 x 641 - 35K
    433 x 629 - 37K
    786 x 755 - 32K
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2011-01-01 00:53
    please delete
  • LeonLeon Posts: 7,620
    edited 2011-01-01 01:48
    The simple answer is Eclipse will handle Mac, Linux, and Windows. It would also support Spin, Pasm, SXB & SXasm, Pbasic, PropBasic and their help sections.

    I started using Eclipse after I volunteered to work with a FIRST team. A few mentors ported Microchip’s MPLAB C18 to Eclipse, now the FIRSTies (our future engineers) use the Wind River Workbench subversion of Eclipse. Eclipse plug-ins have been created to support professionals, students and hobbyists for ARM, AVR & Arduino’s, and all MPLAB tool chains. I have seen additional plug-ins available for an enormous variety of languages including versions of Microsoft Assembler and Basic.

    Interestingly, Microchip themselves has chosen the NetBeans IDE for their new MPLAB-X IDE. It has many advantages over Eclipse.

    Leon
  • YodaYoda Posts: 132
    edited 2011-01-01 11:01
    Leon wrote: »
    Interestingly, Microchip themselves has chosen the NetBeans IDE for their new MPLAB-X IDE. It has many advantages over Eclipse.

    Leon

    Curious - what are the advantages? - I have always heard the opposite and there are many more people using eclipse than NetBeans.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2011-01-01 13:03
    Leon has a long history of negative postings towards Eclipse. My post was like bait on a hook.
  • LeonLeon Posts: 7,620
    edited 2011-01-01 19:26
    Here are Microchip's reasons for going with NetBeans:
    We had many reasons for going with NetBeans instead of Eclipse. However, whichever platform we chose, we would have had the same amount of work to do, so the wheel had to be reinvented either way. Just because Eclipse works with our competitor's platforms doesn't mean that any part of it will automatically work with ours. We would still have to write all the code required to tie the IDE to our compilers, assemblers, hardware tools and to target it to the PIC architecture.

    Some of the reasons we chose NetBeans:

    1. While Eclipse has been around longer and is used by everyone else, it is becoming widely acknowledged among many developer forums that Eclipse is no longer ahead of NetBeans in terms of its feature set. Plus, Eclipse seems to be bloated and slow compared to NetBeans. We've had in-house experience with Eclipse in the form of Hi-Tech's Hi-Tide IDE. So, we had a good basis for comparison.

    2. Because Eclipse is used by everyone else, it would be very difficult for us to work closely with their team to get the features we need added to the core IDE. Conveniently for us, NetBeans was looking for an embedded partner and we were looking for an open source IDE at the same time. Being their only embedded partner means we have a very close working relationship with them and are better able to have the core IDE tweaked to suit our needs.

    3. NetBeans has been around for many years and just like Eclipse is open source and free to use. There is a huge developer community working with NetBeans and many developers have looked at its code. So, we haven't had to spend time or money "finding and fixing kinks" - no more so than we would have had to do with Eclipse.

    Using NetBeans with Schliemann, one can even define one's own language:

    http://wiki.netbeans.org/Schliemann

    and add support for it to the IDE. That might be useful in a Propeller context.

    Having used it for some time, and having used Eclipse a lot as well, I'm quite sure that they made the right choice.

    My favourite IDE is Rowley CrossStudio, used with their ARM, MSP430 and AVR tools. That is written in C++ and is very slick compared to both Eclipse and NetBeans, which are written in Java.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-01-01 20:06
    Java bothers me a little, now that it's controlled by Oracle. Moreover, my experience with OpenOffice under OS/X suggests that it's really, really sloooow.

    -Phil
  • LeonLeon Posts: 7,620
    edited 2011-01-01 20:24
    Get a faster machine!

    Seriously, when I first used Eclipse some years ago I found it was so slow that it was unusable. On current hardware, it is still a bit sluggish, as is NetBeans, but they are usable. OpenOffice is slow compared to MS Office, but I use it (under Windows) because it's free. It runs quite well on the hardware I have.
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-01-01 21:46
    I change my vote from post #65.
    I now vote that Capt Quirk AND Yoda lead the Eclipse effort, as Yoda knows what the hard parts are.

    I further vote that Leon be lead on the NetBeans effort, as he has extensive experience on NetBean and Schliemann which could be the deciding factor if it gives a huge benefit in setting up the Prop's language items.

    Also, he will be in the best position to explain the advantages and disadvatages of both the Eclipse and NetBeans options.

    Ideally, we should be able to tell which options makes the best progress in the shortest amount of time and effort. But this decision will likely need expertise that the average prop tinkerer (i.e. me) does not have.

    Is there anybody else that uses NetBeans that can share the load?
  • jazzedjazzed Posts: 11,803
    edited 2011-01-01 22:26
    Leon wrote: »
    Get a faster machine!

    Seriously, when I first used Eclipse some years ago I found it was so slow that it was unusable. On current hardware, it is still a bit sluggish, as is NetBeans, but they are usable. OpenOffice is slow compared to MS Office, but I use it (under Windows) because it's free. It runs quite well on the hardware I have.

    I found Eclipse to startup slow, but after that it's fine except for running and terminating a program. I've used NetBeans more over the last few years and have enjoyed it mostly. I never tried to use it with anything except Java though. I've used Eclipse with C and compared to the Java "profile" it s*cks.

    So, I guess I would vote for NetBeans. I'm not interested in developing any of this though since I already have plenty to do. Good luck.
  • LeonLeon Posts: 7,620
    edited 2011-01-02 03:46
    A lot of people like Code::Blocks:

    http://www.codeblocks.org/

    I tried it with gcc for a simple Windows console application before Christmas, and was impressed with the user interface and the facilities provided.

    It's written in C++, is cross-platform, and is very fast. It only works with C/C++ code, though.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2011-01-03 03:08
    I am looking for a feature driven IDE for the Propeller, not speed.

    I had problems with Eclipse initially, but the good features out weighed the negatives. With a little work, and Wascana, all the pieces came together.
    For those who want a better C/C++ sub-version, try this one http://sourceforge.net/projects/wascana/

    Also I vote Prof_Braino to be the supreme leader of this effort :)
  • AleAle Posts: 2,363
    edited 2011-01-04 00:09
    I have used both Eclipse-based (XMOS IDE, Flex Builder, AVR32 Studio) and NetBeans (Java, C and nowadays that I mostly abandoned Java... python), but I have much more experience with NetBeans (>7 years) than with Eclipse. XMOS's and Atmel efforts with Eclipse are good and bring a usable and enjoyable experience. Debugging is well... slow. Flex Builder OTOH, in its versions 2 and 3, show how an Eclipse-based IDE should not be implemented. It is just half-backed and the little things make you wish for a plan text editor. Maybe the new version 4 is better but seeing that 3 was a minor improvement in usability versus 2... I doubt it :(.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-04 01:27
    I am looking for a feature driven IDE for the Propeller, not speed.

    I sometimes wonder if any IDE is perfect.

    Right now I'm in the process of hybridising Catalina C and Propeller object code. Why? Well, so I can put the program itself into external 512k memory and hence free up 30k of hub ram for clever video processing. And the ability to load and reload cogs on the fly from within code.

    A crazy project I know!

    Code::Blocks is fine but it can't hybridise PASM and C. And Big Spin is beyond any of us while bits of the compiler and interpreter remain secret.

    Just as an example, this subroutine highlights the keywords in the code, highlights quotes, and changes the color of CON and PUB and DAT code. There is other code that binds the two together.

    When writing code, I spend about half the time writing code and half the time editing the IDE. Not perfect by any means but it does look pretty. And it compiles with one keypress.

    VB.NET may have its disadvantages, but large parts of this code were copied from C help forums, not Basic ones. Yet this is Basic code. There appears to be an convergence of Basic/C/Java within vb.net, and while as a Basic programmer I'm being dragged kicking and screaming through this process, I can see that it is heading towards a common language that is going to be better than all three of these languages [insert waving red flag *grin*]

    I'm using vb.net to help me program in C, and sometimes I wonder if it would almost be easier to do it wholly in C. Or Java.

    Maybe we could all contribute to a new IDE?
        Private Sub ColorCatalina()
            Dim Greenwords As New List(Of String)
            Dim Bluewords As New List(Of String)
            Dim Goldwords As New List(Of String) ' syntax errors
            Dim Purplewords As New List(Of String)
            Dim i, q As Integer
            Dim NumberLines As Integer
            Dim StartLine As Integer
            Dim EndLine As Integer
            Dim LineOfText As String
            Dim GreenFlag, PASMflag, CommentBlockflag, Quoteflag As Boolean
            Dim CurrentColor As New Color
            Dim CommentMarker As Integer
            Dim QuoteMarker As Integer
            GreenFlag = False
            CommentBlockflag = False
            ' http://condor.depaul.edu/sjost/it236/documents/colorNames.htm
            ' purple words
            Purplewords.Add("FILE")
            'Goldwords.Add(" as ") ' should use =
            ' blue words
            Bluewords.Add("char ")
            Bluewords.Add("do")
            Bluewords.Add("#define")
            Bluewords.Add("else")
            Bluewords.Add("for ")
            Bluewords.Add("fopen")
            Bluewords.Add("fclose")
            Bluewords.Add("fread")
            Bluewords.Add("fwrite")
            Bluewords.Add("fputc")
            Bluewords.Add("fgetc")
            Bluewords.Add("fprintf")
            Bluewords.Add("getchar")
            Bluewords.Add("int ")
            Bluewords.Add("if")
            Bluewords.Add("#include")
            Bluewords.Add("kbhit")
            Bluewords.Add("printf")
            Bluewords.Add("return")
            Bluewords.Add("srand")
            Bluewords.Add("void")
            Bluewords.Add("unsigned")
            Bluewords.Add("while")
            Bluewords.Add("_coginit")
            Bluewords.Add("long")
            Bluewords.Add("const")
            SendMessage(RichTextBox1.Handle, WM_SETREDRAW, New IntPtr(CInt(False)), IntPtr.Zero) ' disable refresh
            Dim selectStart As Integer = RichTextBox1.SelectionStart ' preserve cursor
            RichTextBox1.Select(0, RichTextBox1.Text.Length)
            RichTextBox1.SelectionColor = Color.Black ' all text to black
            RichTextBox1.DeselectAll()
            NumberLines = RichTextBox1.Lines.Length
            CurrentColor = Color.Black
            'do blue words
            For Each oneWord As String In Bluewords
                Dim pos As Integer = 0
                Do While RichTextBox1.Text.ToUpper.IndexOf(oneWord.ToUpper, pos) >= 0
                    pos = RichTextBox1.Text.ToUpper.IndexOf(oneWord.ToUpper, pos)
                    RichTextBox1.Select(pos, oneWord.Length)
                    RichTextBox1.SelectionColor = Color.Blue ' change the foreground color
                    'RichTextBox1.SelectionBackColor = Color.Black ' change the background color
                    pos = pos + 1
                Loop
            Next
            Label3.Text = "Start purple"
            System.Windows.Forms.Application.DoEvents() ' update the label
            'do purple words (syntax errors eg using as instead of = because vb.net uses as
            For Each oneWord As String In Purplewords
                Dim pos As Integer = 0
                Do While RichTextBox1.Text.ToUpper.IndexOf(oneWord.ToUpper, pos) >= 0
                    pos = RichTextBox1.Text.ToUpper.IndexOf(oneWord.ToUpper, pos)
                    RichTextBox1.Select(pos, oneWord.Length)
                    RichTextBox1.SelectionColor = Color.Purple
                    pos = pos + 1
                Loop
            Next
            System.Windows.Forms.Application.DoEvents() ' update the richtextbox
    
    
            For i = 0 To NumberLines - 1
                LineOfText = RichTextBox1.Lines(i)
                If Strings.InStr(LineOfText, "/*") <> 0 Then
                    CommentBlockflag = True ' start of comment block
                End If
                If CommentBlockflag = True Then ' block of comments
                    StartLine = RichTextBox1.GetFirstCharIndexFromLine(i) ' start of the line
                    EndLine = RichTextBox1.GetFirstCharIndexFromLine(i + 1) ' end of the line
                    RichTextBox1.Select(StartLine, EndLine - StartLine)
                    RichTextBox1.SelectionColor = Color.Green
                End If
                If Strings.Left(LineOfText, 10) = "PASM Start" Then
                    PASMflag = True
                    CurrentColor = Color.Green ' still in the comment section
                End If
                If Strings.Left(LineOfText, 8) = "PASM End" Then
                    PASMflag = False
                    CurrentColor = Color.Green ' still in the comment section
                End If
                If PASMflag = True And Strings.Left(LineOfText, 3) = "CON" Then
                    CurrentColor = Color.Goldenrod
                End If
                If PASMflag = True And Strings.Left(LineOfText, 3) = "PUB" Then
                    CurrentColor = Color.Firebrick
                End If
                If PASMflag = True And Strings.Left(LineOfText, 3) = "DAT" Then
                    CurrentColor = Color.DarkSlateBlue
                End If
                If PASMflag = True Then
                    StartLine = RichTextBox1.GetFirstCharIndexFromLine(i) ' start of the line
                    EndLine = RichTextBox1.GetFirstCharIndexFromLine(i + 1) ' end of the line
                    RichTextBox1.Select(StartLine, EndLine - StartLine)
                    RichTextBox1.SelectionColor = CurrentColor
                End If
                ' do text in quotes as red
                QuoteMarker = Strings.InStr(LineOfText, Strings.Chr(34)) ' look for "
                If QuoteMarker <> 0 Then
                    StartLine = RichTextBox1.GetFirstCharIndexFromLine(i) ' start of the line
                    EndLine = RichTextBox1.GetFirstCharIndexFromLine(i + 1) ' end of the line
                    For q = 1 To Strings.Len(LineOfText)
                        If Strings.Mid(LineOfText, q, 1) = Strings.Chr(34) Then
                            If Quoteflag = True Then Quoteflag = False Else Quoteflag = True ' start turning text red
                        End If
                        If Quoteflag = True Then
                            RichTextBox1.Select(StartLine + q - 1, 2) 'include the second quote
                            RichTextBox1.SelectionColor = Color.Red
                        End If
                    Next
                End If
                CommentMarker = Strings.InStr(LineOfText, "'") ' search for '
                If CommentMarker <> 0 Then
                    StartLine = RichTextBox1.GetFirstCharIndexFromLine(i) ' start of the line
                    EndLine = RichTextBox1.GetFirstCharIndexFromLine(i + 1) ' end of the line
                    'RichTextBox1.Select(StartLine, CommentMarker - 1) ' text before the comment in the default color
                    'RichTextBox1.SelectionColor = CurrentColor ' this can change depending on the line, usually black
                    RichTextBox1.Select(StartLine + CommentMarker - 1, EndLine - StartLine - CommentMarker) ' comment in green
                    RichTextBox1.SelectionColor = Color.Green
                End If
                CommentMarker = Strings.InStr(LineOfText, "//") ' search for //
                If CommentMarker <> 0 Then
                    StartLine = RichTextBox1.GetFirstCharIndexFromLine(i) ' start of the line
                    EndLine = RichTextBox1.GetFirstCharIndexFromLine(i + 1) ' end of the line
                    'RichTextBox1.Select(StartLine, CommentMarker - 1) ' text before the comment in the default color
                    'RichTextBox1.SelectionColor = CurrentColor ' this can change depending on the line, usually black
                    RichTextBox1.Select(StartLine + CommentMarker - 1, EndLine - StartLine - CommentMarker) ' comment in green
                    RichTextBox1.SelectionColor = Color.Green
                End If
                If Strings.InStr(LineOfText, "*/") <> 0 Then
                    CommentBlockflag = False
                End If
            Next
            RichTextBox1.SelectionStart = selectStart ' restore cursor
            RichTextBox1.SelectionLength = 0
            SendMessage(RichTextBox1.Handle, WM_SETREDRAW, New IntPtr(CInt(True)), IntPtr.Zero) ' restore cursor
            RichTextBox1.Refresh()
        End Sub
    
Sign In or Register to comment.