Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > HTML Color Coding Prog (Released)


Reply
 
Thread Tools Display Modes
  #1  
Old 08-28-2001, 08:15 AM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default HTML Color Coding Prog (Released)


I got bored yesterday, so I wrote a prog to color code the BB text (with the markup tags).

It' just a first public release and has bugs (probably), and also the code it creates is very messy, so I'll test it.

<pre><font color=blue>Sub</font color=blue> fake(fake <font color=blue>As</font color=blue> <font color=blue>Integer</font color=blue>)

<font color=green>'this is a test comment
</font color=green> <font color=green>'1
</font color=green> <font color=green>'2
</font color=green> <font color=green>'3
</font color=green>
<font color=blue>Dim</font color=blue> A <font color=blue>As</font color=blue> <font color=blue>Integer</font color=blue>

<font color=blue>For</font color=blue> A = 0 <font color=blue>To</font color=blue> 1000
A = A + fake
<font color=blue>Next</font color=blue> A

<font color=blue>End</font color=blue> <font color=blue>Sub</font color=blue></pre>

Did it work? I'll post the program in a little while.

Reply With Quote
  #2  
Old 08-28-2001, 08:18 AM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default Re: HTML Color Coding Prog

here's the VB project. Some of the code may not be real effecient, and instead of checking for quotes the CHR way, I used a Label Control (chock it up to laziness) but it works fine. I may have also missed some of the key-words for highlighting. If you find any, let me know.

Reply With Quote
  #3  
Old 08-28-2001, 09:03 AM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default Re: HTML Color Coding Prog

Anyone tried it? I'd like some feedback\suggestions\bugs.

Reply With Quote
  #4  
Old 08-28-2001, 09:43 AM
PWNettle PWNettle is offline
Verbose Coder

Retired Moderator
* Guru *
 
Join Date: Dec 1999
Location: Phoenix, Arizona
Posts: 3,011
Default Re: HTML Color Coding Prog

<pre><font color=blue>Public</font color=blue> <font color=blue>Sub</font color=blue> Test(ValueIn <font color=blue>As</font color=blue> <font color=blue>Integer</font color=blue>)

<font color=green>' This is just a test.
</font color=green> MsgBox ValueIn

<font color=blue>End</font color=blue> <font color=blue>Sub</font color=blue></pre>It seems to work just fine and it's pretty cool. I'm not sure I'd use it as I am kinda lazy but it does make code samples look nice.

You might have it add (maybe optionally) the pre and /pre markup tags. I like my forms to startup in the middle of the screen - but that's just me.

Cheers,
Paul

Reply With Quote
  #5  
Old 08-28-2001, 09:49 AM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default Re: HTML Color Coding Prog

the pre thing would be easy, as would the middle of the screen thing. I also have to make it not color code words in comments.. i.e.

<pre><font color=blue>Sub</font color=blue> Test()
<font color=green>'test test <font color=blue>For</font color=blue> test test <font color=blue>If</font color=blue> <font color=blue>Then</font color=blue> <font color=blue>End</font color=blue> <font color=blue>If</font color=blue>
</font color=green><font color=blue>End</font color=blue> <font color=blue>Sub</font color=blue></pre>


Reply With Quote
  #6  
Old 08-28-2001, 09:59 AM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default Re: HTML Color Coding Prog

New Stuff
- no longer case sensitive
- starts center screen
- pre tags added on "Copy"
- larger display
- no longer highlights within quotes

Reply With Quote
  #7  
Old 08-28-2001, 10:04 AM
Derek Stone
Guest
 
Posts: n/a
Default Re: HTML Color Coding Prog

Now your talkin'... good work.
Add the ability to resize the window and add more keywords (copy them from Object Browser).

Regards,
-cl

Reply With Quote
  #8  
Old 08-28-2001, 10:05 AM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default Re: HTML Color Coding Prog

great! I'll go do that.

Reply With Quote
  #9  
Old 08-28-2001, 10:22 AM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default Re: HTML Color Coding Prog

Where exactly in the ObjBrowser do I find keywords?

Reply With Quote
  #10  
Old 08-28-2001, 10:39 AM
Derek Stone
Guest
 
Posts: n/a
Default Re: HTML Color Coding Prog

Hmm... guess I was mistaken... stupid Object Broswer...

Regards,
-cl

Reply With Quote
  #11  
Old 08-28-2001, 10:47 AM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default Re: HTML Color Coding Prog

If you look in the Object Browser under the VBA library, you will see many
of the function keywords under Conversion, DateTime, FileSystem,
Financial, Information, Interaction, Math, and Strings.

I think therefore I am... sometimes right. [img]images/icons/wink.gif[/img]
__________________
Posting Guidelines
Reply With Quote
  #12  
Old 08-28-2001, 11:04 AM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default Re: HTML Color Coding Prog

The VFBBCF v1.2:
- more keywords
- resizealble
- up-to-date EXE

Reply With Quote
  #13  
Old 08-28-2001, 11:13 AM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default Re: HTML Color Coding Prog

Ok, sorry about all the quick updates and stuff, this'll probably be the last one. I just made it so that it reads the keywords out of KEYWORD.DAT so I can add\upload and you can add easily.

Reply With Quote
  #14  
Old 08-28-2001, 11:17 AM
Developer
Guest
 
Posts: n/a
Default Re: HTML Color Coding Prog

<font color=blue>Sub</font color=blue> fake(fake <font color=blue>As</font color=blue> <font color=blue>Integer</font color=blue>)

<font color=green>'this is a test comment
</font color=green> <font color=green>'1
</font color=green> <font color=green>'2
</font color=green> <font color=green>'3
</font color=green>
<font color=blue>Dim</font color=blue> A <font color=blue>As</font color=blue> <font color=blue>Integer</font color=blue>

<font color=blue>For</font color=blue> A = 0 <font color=blue>To</font color=blue> 1000
A = A + fake
<font color=blue>Next</font color=blue> A

<font color=blue>End</font color=blue> <font color=blue>Sub</font color=blue>

Hey it works!!! Great WOrk VolteFace!

"Visual Basic - 10 Years Taking The World By Storm" - [i]Microsoft[i]
Reply With Quote
  #15  
Old 08-28-2001, 11:36 AM
Developer
Guest
 
Posts: n/a
Default Re: HTML Color Coding Prog

Hey! The app is blimin great! For some reason the Copy button doesn't do its job!

I can't see why! Have a look!

"Visual Basic - 10 Years Taking The World By Storm" - [i]Microsoft[i]
Reply With Quote
  #16  
Old 08-28-2001, 11:38 AM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default Re: HTML Color Coding Prog

um... it works for me...

Reply With Quote
  #17  
Old 08-28-2001, 06:36 PM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default Re: HTML Color Coding Prog

here's just a small update to keyword file of the prog
make sure you rename the file to KEYWORD.DAT and put it in the directory with the HTML program.
Reply With Quote
  #18  
Old 08-29-2001, 05:47 AM
CornMaster's Avatar
CornMaster CornMaster is offline
Contributor
 
Join Date: Aug 2000
Location: St. John's, Newfoundland
Posts: 655
Default Re: HTML Color Coding Prog

I get an error about "Component 'RICHTX32.OCX' or one of it's dependencies not correctly registered: a file is missing or invalid."

But then again....I don't have VB installed at work. :-D

So I'll take a look when I get home.

~Complex Solutions to Simple Problems!!~
CornEmpire Ruler
http://www.cornempire.com
__________________
~Complex Solutions to Simple Problems~
http://www.cornempire.com
Reply With Quote
  #19  
Old 08-29-2001, 07:16 AM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default Re: HTML Color Coding Prog

Yes, since it's a program for colorizing your Visual Basic code, I don't feel the need to make it work for users without VB. [img]images/icons/smile.gif[/img]

Although, I'm not sure if it would work with VB5.

Reply With Quote
  #20  
Old 08-30-2001, 01:55 PM
Volte's Avatar
Volte Volte is offline
Ultimate Contributor

Retired Leader
* Guru *
 
Join Date: Aug 2001
Posts: 5,343
Default Re: HTML Color Coding Prog

OK, new update. Added a preview dialog for seeing the actual colored text. Also, I had to lock the textbox because it caused problems with the preview dialog. Also updated the KEYWORD file.

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->