Quote: "only have one question to ask, is, how did you do the syntax highlighting? I cant get everything done correctly, and when I attempt parsing, after a few lines, the prog becomes dred-fully slow.. So I had to rely on an outside source for the parsing, which is just a set of functions, and it's rather limited, but quick. (I cant learn anything from it).
"
I'll answer the best I can, but this is a very large and complex topic. It's kinda like asking me "how does a car move?"
I'm using the SynEdit for the code editor. It has several highlighters that come with it, but none of them understood the style of DBP's keywords, so I took one that looked the closest (TSynGeneral) and modified its source to work properly. The SynEdit component takes care of painting the text the proper color, etc. In looking at the code, it would appear that it only bothers to update what's on the screen, so it doesn't have to do a lot of useless work.
Now, here's what I had to do to get the highlighter working properly. I had to get the highlighter to understand when a DBP keyword was actually a keyword or when a comment occured, etc. Keywords were definitely the hardest part of this.
So, the first thing to do is to get the list of all the keywords from the .ini files on startup. Then it alphabetizes the list and discards any duplicates. Then, I create an array that holds what indexes the keywords for each letter start and end. This is for optimization, of course. When the highlighter is asked to determine if some text is a keyword, rather than just searching through the whole list until it finds it or doesn't, it'll look at the first letter of the text, and that determines where in the list of keywords it should start looking and where it should stop. Then I have a loop that looks through this smaller list of keywords. But I also added one more optimization. Rather than just going from the first of all keywords that start with "a" for example, the first iteration of the loop looks at the first of the list, the second looks at the last, and so forth until the loop reaches the middle of the list. This speeds things up for if the keyword is near the end of the list.
Hopefully that gives you some idea of what I'm doing. There's even more to it than that, but it could take a long time to explaing. Feel free to email me if you'd like.
Quote: "Will there be added functionality for Shark Basic?"
Of Course
not.
I had seen that thread before but somehow I missed all the Guppy Basic and Algae Basic posts. Thanks for the good laugh. :D
Quote: "he's just (not downplaying anything by saying just) writing an IDE (glorified notepad that saves/loads and exports the dba files)."
Very glorified and sophisticated notepad.
@Diggsey,
Good job. But I see one fundamental flaw. You say it only highlights the current line. What happens if you have a remstart/remend block and you remove the remstart?
Also, what does CS do wrong with highlighting that example? It highlights all the keywords for me.
Good performance is better than a good excuse.
CodeSurge -- DBP Editor for serious programmers.