1up Clan Forums

Gaming => Urban Terror => 4.2 UrT Server => Topic started by: Tesla[1up] on November 09, 2010, 10:53:35 AM

Title: Code syntax highlighting example.
Post by: Tesla[1up] on November 09, 2010, 10:53:35 AM
Introduction:

The forums now support automatic syntax highlighting for the following programming languages when used inside of a bbc code block element. See below for examples of some basic hello world apps.

Supported Languages

 1C
 AVR Assembler
 Apache
 Axapta
 Bash
 C#
 C++
 CMake
 CSS
 DOS .bat
 Delphi
 Django
 HTML, XML
 Ini
 Java
 Javascript
 Lisp
 Lua
 MEL
 PHP
 Parser3
 Perl
 Python
 Python profile
 RenderMan
 Ruby
 SQL
 Scala
 Smalltalk
 TeX
 VBScript
 VHDL
 diff
 nginx

Examples:

Java

Code: [Select]
class myfirstjavaprog

        public static void main(String args[])
        {
           System.out.println("Hello World!");
        }
}

Delphi

Code: [Select]

program ConsApp;
{$APPTYPE CONSOLE}
uses
  SysUtils;
begin
// Delphi's version of a simple hello world app.
  writeln('Hello World');
  writeln('Press the ENTER key to stop the program');
  readln;
end.


Bash Script

Code: [Select]
#!/bin/bash
# Lets declare a STRING variable
STRING="Hello World"
#Using echo command to print value of a variable on screen
echo $STRING

Visual Basic

Code: [Select]
' A "Hello, World!" program in Visual Basic.
Module Hello
  Sub Main()
      MsgBox("Hello, World!") ' Display message on computer screen.
  End Sub
End Module

JavaScript

Code: [Select]
<script type="text/javascript">
document.write('<b>Hello World</b>');
</script>

Tesla[1up]