News: 1up Discord VOIP
Invite Code: https://discord.gg/VPv9JhP

Author Topic: Code syntax highlighting example.  (Read 1426 times)

0 Members and 1 Guest are viewing this topic.

Offline Tesla[1up]

  • *Administrative Leave
  • [1up] Dev Admin
  • [1up] UrT Admin
  • Posts: 480
  • Karma: 106
  • Since: 07/07/2009
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Code syntax highlighting example.
« 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]
« Last Edit: November 09, 2010, 05:15:37 PM by Tesla[1up] »
"May I suggest the footing of your ass" Red Forman