# VBForums UtilityBank > UtilityBank - Tutorials >  VBForums Code Tags

## dday9

*Introduction*
You may have been linked to this thread because you did not properly format your code in VBForums using the code BB tag. The purpose of this thread is to explain the purpose of code tags and to walk you through the process of using VBForums' code tags. At the end of this post you will find an animated GIF which shows you the process if you are a move visual learner.

*Purpose of Code Tags*
Code tags help preserve the whitespace in your code which makes it easier to read. In some cases, like python code, indentation is a necessity.

*Walkthrough*
Step 1) Type or paste your code into VBForums' text editor.
Step 2) Select the entirety of your code.
Step 3) Click the _#_ button in the toolbar above the text editor.

Your code in the text editor should look similar to this:
[CODE]Console.WriteLine("Hello World!")[/CODE]

*Example Output*
Without Code Tags
With Code Tags

Option Strict On
Public Module Module1
    Public Sub Main()
        Console.WriteLine("Hello world!")
    End Sub
End Module


```
Option Strict On
Public Module Module1
    Public Sub Main()
        Console.WriteLine("Hello world!")
    End Sub
End Module
```





*Advanced*
You can elect to include syntax highlighting in your code by using the highlight tag. Follow steps 1 and 2 in the walkthrough but for step 3 click on the _VB_ button in the toolbar above the text editor. This will bring up a dialog that prompts you to enter the option, this is where you would input the language. The following are a list of acceptable languages:

ABAPActionscriptAdaApacheAppleScriptx86 AssemblerASPBASHBlitzBasicBNFAutoCAD/IntelliCAD LispCFDGColdFusionC for MacsCC++C#CSSDelphiDiff-outputDIVDOSdotDEiffelFortranFreeBasicGeneroGMLGroovyHaskellHTML 4.01 strictUnoidlINIInno ScriptIoJavaJavaJavaScriptGeneric LispLUAMotorola 68000 AssemblerMatlab M-filemIRC ScriptingMicrochip AssemblerMySQLNullsoft Scriptable Install SystemObjective COCamlOpenOffice.org BasicOracle 8PascalPerlPerPHPPHPOracle 9.2 PL/SQLPythonQBasic/QuickBASICrobots.txtRubySASSchemesdlBasicSmalltalkSmarty templateSQLTCL/iTCLthinBasicT-SQLVB.NETVisual BasicVHDLVisual FoxProWinBatchXMLAxapta/Dynamics Ax X++ZiLOG Z80 Assembler

*Example Output of Highlight*

VB.NET Code:
Private Sub Main()
    Dim foo As String = "foo"
    Console.WriteLine(foo)
     foo = "bar"
    Console.WriteLine(bar)
End Sub


BNF Code:
expression ::= number | expression, operator, expression | openParen, expression, closeParen
number ::= [unaryOperator], digitExcludingZero, {digit}, [decimal, {digit}, digitExcludingZero]
digit ::= (digitExcludingZero | '0'), {digit}
digitExcludingZero ::= '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
operator ::= unaryOperator | '*' | '/' | '^'
unaryOperator ::= '+' | '-'
openParen ::= '('
closeParen ::= ')'


JavaScript Code:
window.onload = function() {
    document.getElementById('btnFoo').onclick = bntFoo_Click;
}
 function btnFoo_Click() {
    alert('foo!');
}

*Update*
Apparently after some updates, the advanced highlight tags no longer do syntax highlighting.

*Animated GIF*

Apparently after some updates, animated GIFs do not play. However, I have the image linked to the hosting service. If you click on the image you will be redirected to the animated image.

----------


## techgnome

Step 2 should be "Select" ... the code, not copy...

-tg

----------


## dday9

Good catch, I changed the wording. I've also added some examples of using the [highlight][/highlight] tag.

----------

