Log in

View Full Version : Code Formatting Hack?? C#/Visual Basic


MultiSync77F
10-05-2007, 03:21 AM
There is a really nice php bbcode for vB that does a very good job of highlighting syntax for the code. The [ code ] tag really sucks. Is there a hack or custom bbcode or something that will do the same thing for C# or vb.net languages?

It really makes my forum look like crap and its hard to read the code people post because its all black and white and syntax or other errors just dont stand out like they would if you viewed the code in VS IDE.

Also when you copy and paste code from VS IDE into vB it completely destroys the formatting of the code, and truncates the spaces in key words, is there a way to fix this? Right now I have to copy the code into notepad and then back into vB and its really annoying.

For example:

private static readonly uint?

becomes

privatestaticreadonlyuint?

when you cut and paste directly from VS IDE. :(

MultiSync77F
10-09-2007, 08:30 PM
*bump*

So there is nothing like this? With all these hacks, some of them pretty outragious. A lot of forums use code in their posts. I can't believe there isn't a .Net Code Box.

Thanks.

Analogpoint
10-09-2007, 09:10 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=93071" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=93071</a>

Dismounted
10-10-2007, 05:58 AM
*bump*

So there is nothing like this? With all these hacks, some of them pretty outragious. A lot of forums use code in their posts. I can't believe there isn't a .Net Code Box.

Thanks.
That's because we have to develop functions to highlight the code. PHP already has a function built-in to highlight PHP code.

Analogpoint
10-10-2007, 01:27 PM
That's because we have to develop functions to highlight the code. PHP already has a function built-in to highlight PHP code.

Use Geshi (http://qbnz.com/highlighter/), no need to reinvent the wheel. Although, if he's talking about having it built into vB, I think it belongs in a mod.

Dashman
05-20-2008, 01:57 PM
For example:

private static readonly uint?

becomes

privatestaticreadonlyuint?



I have this same problem in 3.7. when pasting Java code from my IDE into VB.

My site is based around people submitting code so this is a really big problem for me!!

Can you let me know if you manage to fix this? Thanks!!