Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / text editor + keyword highlighter

Author
Message
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Jan 2007 22:11
I have been writing a text editor and keyword highlighter to work with dbpro keywords. It is written in VB, and it may (in the very far away future) become an IDE for DBPro.

At the moment, it highlights all keywords in a text file perfectly, and remend, remstart, rem, `, and strings all highlight correctly

I haven't tried it on anything very big yet, but as the highlighting only works on the edited lines, it should not make too much difference.

I have barely worked on the UI at all yet, so here is a screenshot just showing the syntax highlighting:


PS
If this does become an IDE, this is probably V0.000001!

Dared1111
17
Years of Service
User Offline
Joined: 25th Oct 2006
Location:
Posted: 29th Jan 2007 22:40
what db is it for pro or classic?

Who wants a Lemon?

I love lemons... and cats
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 30th Jan 2007 00:24
Heh, pretty cool. What are you using for the editor control? And why are you using the default CodeSurge colors?

Good luck if you decide to make it into an IDE.

Good performance is better than a good excuse.
CodeSurge -- DBP Editor for serious programmers.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Jan 2007 00:33
Really cool. Just downloaded VB Express myself. I don't like it, it's too different from VB 6 which is what I'm used to...

GatorHex
19
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 30th Jan 2007 00:49 Edited at: 30th Jan 2007 00:51
Do something useful and write me a free text editor that works on Linux I hate freekin using Vi

http://www.KumKie.com http://bulldog.servegame.com
Jrock
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Riven
Posted: 30th Jan 2007 02:51 Edited at: 30th Jan 2007 02:51
Looks cool, I tried writing a text editor for FPSC script files, but I couldn't figure out how I'd do syntax hightlighting

Anyway, keep up the good work Diggsey!

http://www.game-monitor.com/server-stat-image/72.232.134.166:16567.png
Vampiric
17
Years of Service
User Offline
Joined: 30th Oct 2006
Location:
Posted: 30th Jan 2007 10:44
Jrock email me I might be able to make that.

Computer says n00bed
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 30th Jan 2007 11:18
How did you manage the highlighting?I have bein looking after that for a while,but it never worked with me!

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Jan 2007 14:30
I don't use VB, but in any case, I would make a simple tokeniser, which basically splits everything up into sections. I made one once, so with this line:
newxvalue(x,ax,100)

would split it up into:
newxvalue
(
x
,
ax
,
100
)

So you flip through all the tokens, and if the current token is a keyword, then - highlight!

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 30th Jan 2007 18:14
@Dared1111
It's for DBPro, but with a bit of modification, I could get it to work for DBC as well.

@hyrichter

Sorry about the colours, but I'm used to those now, and when I did it other colours, it looked odd!

Also, as I haven't done any work on the look yet, (I needed to see if I could do the highlighting first) I used codesurge as a base.

If you want me to change them, I will

@Prince Of Darkness
When the user edits something in the textbox, it finds all of the lines which have been affected by the change. It then loops through the letters. When a recognised command is found, it makes sure that either a newline char, a space, an open bracket, or its the end of the text, then highlights that text. It also makes sure that the char before it is not a letter or number (it could be a variable) and also that it is not between a remstart and remend. (these are checked for seperately, and the locations are stored in an array)

If it hits a ", it loops through until it finds a second one, or an end of line char.
If it hits a ` it loops until an end of line char is found.

I hope that explains it all!

@Everyone else
Thanks for the encouragement!

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 30th Jan 2007 18:20
Thanks.i think i can do something now.

Login to post a reply

Server time is: 2024-09-29 18:42:12
Your offset time is: 2024-09-29 18:42:12