How to use the Syntax Highlighter

Posts 115 of 20 · Page 1 of 2
How to use the Syntax Highlighter
This guide is subject to change, along with the tag/options responsible for it.

Code:
[Highlight=LANGUAGE]CODE HERE[./Highlight]
Remove the "." in there.
Various languages can be used, and are also used to replace the "LANGUAGE" bit in the bbcode above:
Code:
 ABAP
Actionscript
ADA
Apache Log
AppleScript
APT sources.list
ASM (m68k)
ASM (pic16)
ASM (x86)
ASM (z80)
ASP
AutoIT
Backus-Naur form
Bash
Basic4GL
BlitzBasic
Brainfuck
C
C for Macs
C#
C++
C++ (with QT)
CAD DCL
CadLisp
CFDG
CIL / MSIL
COBOL
ColdFusion
CSS
D
Delphi
Diff File Format
DIV
DOS
DOT language
Eiffel
Fortran
FourJ's Genero
FreeBasic
GetText
glSlang
GML
gnuplot
Groovy
Haskell
HQ9+
HTML
INI (Config Files)
Inno
INTERCAL
IO
Java
Java 5
Javascript
KiXtart
KLone C & C++
LaTeX
Lisp
LOLcode
LotusScript
LScript
Lua
Make
mIRC
MXML
MySQL
NSIS
Objective C
OCaml
OpenOffice BASIC
Oracle 8 & 11 SQL
Pascal
Perl
PHP
Pixel Bender
PL/SQL
POV-Ray
PowerShell
Progress (OpenEdge ABL)
Prolog
ProvideX
Python
Q(uick)BASIC
robots.txt
Ruby
Ruby on Rails
SAS
Scala
Scheme
Scilab
SDLBasic
Smalltalk
Smarty
SQL
T-SQL
TCL
thinBasic
TypoScript
Uno IDL
VB.NET
Verilog
VHDL
VIM Script
Visual BASIC
Visual Fox Pro
Visual Prolog
Whitespace
Winbatch
Windows Registry Files
X++
XML
Xorg.conf
Example:
[highlight=c++]
bool WINAPI DllMain(HMODULE hModule, DWORD uReason, LPVOID lpReserved)
{
if (uReason == DLL_PROCESS_ATTACH)
{
//JUST A DLL
}
}
[/highlight]

I'm aware the color is kinda ugly, hopefully we will change those later.
Unable to select multiple lines =3
Works for me, need to get a copy swf.
Very nice, Been looking forward to this.

Test:

C (source as listed above to test)

[Highlight=c++]bool WINAPI DllMain(HMODULE hModule, DWORD uReason, LPVOID lpReserved)
{
if (uReason == DLL_PROCESS_ATTACH)
{
//JUST A DLL
}
}
[/highlight]

I think the strings may be off compared to whats in the list. I also need to get rid of that damn messagebox & use a default style when none are found.
This will kill messy source codes round here, nice
[highlight=vb]
Dim Cashmoney as integer = "5"
Msgbox (CashMoney)
[/highlight]

[highlight=c++]
bool WINAPI DllMain(HMODULE hModule, DWORD uReason, LPVOID lpReserved)
{
if (uReason == DLL_PROCESS_ATTACH)
{
//JUST A DLL
}
}
[/highlight]


[highlight=c]
if(highlighting == fucking.awesome())
{
cout<<"hell yeah!";
}else{
GTFO();
}
[/highlight]
[Highlight=vbnet]
For i As integer = 0 to 5 'loooooooooooooooooooop
MsgBox("IM TESTING STRINGS")
Dim testVariable As String = ""
Next
[/Highlight]


Will not work
[highlight=vb]
For i As integer = 0 to 5 'loooooooooooooooooooop
MsgBox("IM TESTING STRINGS")
Dim testVariable As String = ""
Next
[/highlight]

That's how its done.

[/highlight=language_here][/highlight]
EDIT: well nvm NG already said this. Well my internet went out so Hmmph! I'm posting it anyway.
It is Highlight, Not Xcode

So [Highlight = lang] [/Highlight]

Just now we need a list of supported languages.

Yes, I also edited daves post to reflect the changes, just going to get the supported list off the vB plugin site and add it as well.

Another note, during this change for some reason, PHP Tags no longer work, so if you will use PHP tags, use Highlight = php

Another Note: (as a reminder because I seen jason did it originally)
VB Highlighting is different then vbnet highlighting

If you are writing vb6 or < or VBA/Vbscript code then use
highlight=vb , if you are using vb.net code, then use highlight=vbnet


-----------------------------------------------------------------------

PHP Test (highlight=php)
[highlight=php]
<?php
Print "Testing Print";
?>
[/highlight]

SQL TEST(highlight=sql)
[highlight=sql]
<<testhighlight.sql>>=
SELECT 'highlight syntax';
[/highlight]


XML TEST(highlight=xml)
[highlight=xml]
<?xml version="1.0" encoding="UTF-8"?>

<root>
<title>
Testing Highlight Text in vB on MPGH
</title>
<para>
This is a simple test of XML highlighting on MPGH.net
</para>
<note>
(If this doesn't work I will rage quit)
</note>
<!-- Ignore me, I'm just a comment, let's see if it highlights me -->
<para>
This page written by:
<ital>Richard (Nextgen1)</ital>
</para>
<para>
Copyright 2011 All rights reserved.
</para>
</root>
[/highlight]


APPLESCRIPT TEST (highlight=applescript)
[highlight=APPLESCRIPT]
<<Highlighttest.scpt>>=
tell application "Finder"
"highlight works!"
end tell
[/highlight]

Html Test - (highlight=html)
[highlight=HTML]
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>
Testing HTML highlights
</TITLE>
</HEAD>
<BODY>
<H1>Tests</H1>
</HR>
<H4>Test One</H4>
<P>Does this work?</P>
</br>
<H4>Test Two</H4>
<P>Does this work?</P>
<div id="test" style="color:#00FF00">
<iframe src="http://mpgh.net" width="30%" height="30">
<p>Testing Iframes and Div tags</p>
</iframe>
</div>
</BODY>
</HTML>
[/highlight]

Vb Net Test (highlight=vbnet)
[highlight=vbnet]
Public Class Form1

Private Sub Form1_Load(ByVal Form1 As System.Object, ByVal Load As System.EventArgs) Handles MyBase.Load
Static MsgOn As Boolean = False
If Not MsgOn Then
MessageBox.Show("This highlight is working")
End If
MsgOn = True
End Sub
End Class
[/highlight]

VBA/Vb6</Vbscript Test (highlight=vb)
[highlight=vb]
If (kbdllhs.vkCode = VK_F4) And _
CBool(kbdllhs.flags And _
LLKHF_ALTDOWN) Then

Debug.Print ""
LowLevelKeyboardProc = 1
Exit Function
End If
[/highlight]


So far applescript and html do not seem to work, it may as well be the argument "html" and "applescript" , however i'm not sure.




[highlight=php]'This is cool!'[/highlight]


Thanks dave!

Better for no Copy + Paste noobs.


Only if php worked..

[php]See!?[/php]
This proves i dont read stickies..
Thanks dave..
The VB syntax is a horrible color, both .net and vb . I think I'll just keep using my syntax highlighter for now
Posts 115 of 20 · Page 1 of 2

Post a Reply

Tags for this Thread

None

Need help?