Navigation
Home News Examples Demo Downloads FAQ Documentation Mailing Lists License
Support GeSHi!
If you're using GeSHi, why not help GeSHi out? You can link to GeSHi with this image:
Powered by GeSHi
Get the HTML

Project Status
The latest stable version of GeSHi is 1.0.8.11, released on the 19th of Aug, 2012.

Supported Languages:
*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

GeSHi 1.0.8.11 is the current stable release, with eighteen new languages and bug fixes over the last release.

GeSHi 1.1.2alpha5 is the current latest version from the development branch, with full C support (see the GeSHi development website).
Subscribe
RSS 2
Mailing Lists
HomeNewsExamplesDemoDownloadsFAQDocumentationMailing ListsLicense 
12:44 pm GMT

GeSHi - Generic Syntax Highlighter


 

Latest News

News Archive

Random Screenshot

[small0.png: Click for a larger view]

Demonstration


Language:  

Runtime Example

Sub MergeDocumentsInDirectory()

  Dim DestDirectory As String
  Dim FileName As String
  Dim SrcFile As String, DstFile As String
  Dim oDesktop, oDoc, oCursor, oText
  Dim argsInsert()
  Dim args()
  ' Remove the following comments to do things hidden
  ' dim args(0) as new com.sun.star.beans.PropertyValue
  ' args(0).name = "Hidden"
  ' args(0).value = true

  ' Which desitnation directory?
  DestDirectory = Trim( GetFolderName() )

  If DestDirectory = "" Then
    MsgBox "No directory selected, exiting",16,"Merging Documents"
    Exit Sub
  End If

  ' force a trailing backslash. This is okay because using URL notation
  If Right(DestDirectory,1) <> "/" Then
    DestDirectory = DestDirectory & "/"
  End If

  oDeskTop = CreateUnoService("com.sun.star.frame.Desktop")

  ' Read the first file!
  FileName = Dir(DestDirectory)
  DstFile = ConvertToURL(DestDirectory & "ResultatFusion.sxw")
  Do While FileName <> ""
    If lcase( right(FileName,3)) = "sxw" Then
      SrcFile = ConvertToURL(DestDirectory & FileName)
      If IsNull(oDoc) OR IsEmpty(oDoc) Then
        FileCopy( SrcFile, DstFile )
        oDoc = oDeskTop.Loadcomponentfromurl(DstFile, "_blank", 0, Args())
        oText = oDoc.getText
        oCursor = oText.createTextCursor()
      Else
        oCursor.gotoEnd(false)
        oCursor.BreakType = com.sun.star.style.BreakType.PAGE_BEFORE
        oCursor.insertDocumentFromUrl(SrcFile, argsInsert())
      End If
    End If
    FileName = dir()
  Loop

  If IsNull(oDoc) OR IsEmpty(oDoc) Then
    MsgBox "No documents merged!",16,"Merging Documents"
    Exit Sub
  End If

  ' Save the document
  Dim args2()
  oDoc.StoreAsURL(DestDirectory & "ResultatFusion.sxw",args2())
  If HasUnoInterfaces(oDoc, "com.sun.star.util.XCloseable") Then
    oDoc.close(true)
  Else
    oDoc.dispose
  End If

  ' Reload the document!
  oDoc=oDeskTop.Loadcomponentfromurl(DstFile,"_blank",0,Args2())
End Sub