Click here to Skip to main content
15,565,146 members
Home / Discussions / C#
   

C#

 
GeneralRe: Best method for syntax highlighting Pin
WebMaster16-Jul-09 7:12
WebMaster16-Jul-09 7:12 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn16-Jul-09 7:49
sitebuilderLuc Pattyn16-Jul-09 7:49 
GeneralRe: Best method for syntax highlighting Pin
WebMaster16-Jul-09 22:54
WebMaster16-Jul-09 22:54 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn17-Jul-09 0:01
sitebuilderLuc Pattyn17-Jul-09 0:01 
GeneralRe: Best method for syntax highlighting Pin
WebMaster17-Jul-09 4:14
WebMaster17-Jul-09 4:14 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn17-Jul-09 4:26
sitebuilderLuc Pattyn17-Jul-09 4:26 
GeneralRe: Best method for syntax highlighting Pin
WebMaster17-Jul-09 5:59
WebMaster17-Jul-09 5:59 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn17-Jul-09 12:15
sitebuilderLuc Pattyn17-Jul-09 12:15 
Hi,

I haven't read all that in detail, here are some comments for you:

1. you seem to create a new Font for each new keyword; that is a waste, most of those fonts would be identical (maybe there is a regular and a bold, but not dozens of variations)

2. your "parser" seems to split a line by all kinds of special symbols, which will chop a line in many parts, e.g. two-character operators will be split, which isn't necessary (and maybe not what you want, you probably will end up coloring operators too)

3. your "parser" seems ignorant about digits. Not sure that will work well.

4. you are parsing and storing results in arrays. Why? Arrays are trouble, since you must declare them (you forgot that part) and set an arbitrary size. Sooner or later someone will enter a line that exceeds your parsing capabilities. If you must store an unknown number of items, use a List. However there is no need to store the data, you can paint line parts as you go, while parsing! Yes my parser sits inside my Paint handler, however it only parses the visible lines.

I'm sure the list isn't complete however you have to come up with ideas and critical thinking yourself.
One advice: don't keep adding code while existing code isn't compiling/running/running almost correctly. It may soon grow well above your head and become unmanageable.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Best method for syntax highlighting Pin
WebMaster17-Jul-09 22:39
WebMaster17-Jul-09 22:39 
GeneralRe: Best method for syntax highlighting Pin
WebMaster28-Jul-09 9:41
WebMaster28-Jul-09 9:41 
GeneralRe: Best method for syntax highlighting Pin
Luc Pattyn28-Jul-09 23:37
sitebuilderLuc Pattyn28-Jul-09 23:37 
GeneralRe: Best method for syntax highlighting Pin
Kevin Marois14-Jul-09 10:08
professionalKevin Marois14-Jul-09 10:08 
GeneralRe: Best method for syntax highlighting Pin
Adam R Harris14-Jul-09 11:32
Adam R Harris14-Jul-09 11:32 
QuestionPassing a pointer to array of structs via P/Invoke Pin
Klempie14-Jul-09 7:29
Klempie14-Jul-09 7:29 
Questioncustomizing a ToolStripTextBox Pin
Jim Crafton14-Jul-09 6:38
Jim Crafton14-Jul-09 6:38 
AnswerRe: customizing a ToolStripTextBox Pin
Henry Minute14-Jul-09 6:53
Henry Minute14-Jul-09 6:53 
GeneralRe: customizing a ToolStripTextBox Pin
Jim Crafton14-Jul-09 7:04
Jim Crafton14-Jul-09 7:04 
GeneralRe: customizing a ToolStripTextBox Pin
DaveyM6914-Jul-09 7:26
professionalDaveyM6914-Jul-09 7:26 
Questionreturn string Pin
AndyInUK14-Jul-09 6:22
AndyInUK14-Jul-09 6:22 
AnswerRe: return string Pin
Simon P Stevens14-Jul-09 6:28
Simon P Stevens14-Jul-09 6:28 
GeneralRe: return string Pin
AndyInUK14-Jul-09 6:36
AndyInUK14-Jul-09 6:36 
AnswerRe: return string Pin
Luc Pattyn14-Jul-09 6:42
sitebuilderLuc Pattyn14-Jul-09 6:42 
GeneralRe: return string Pin
AndyInUK14-Jul-09 7:19
AndyInUK14-Jul-09 7:19 
GeneralRe: return string Pin
Luc Pattyn14-Jul-09 7:27
sitebuilderLuc Pattyn14-Jul-09 7:27 
GeneralRe: return string Pin
musefan14-Jul-09 8:10
musefan14-Jul-09 8:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.