Xbase ++

from Wikipedia, the free encyclopedia

Xbase ++
Xbase ++
Xbase ++ " Hello world ":

PROCEDURE Main
msgbox ("Hello world!", Version ())
RETURN

Basic data
Paradigms : Object oriented

and procedural language

Publishing year: 1997
Developer: Alaska Software Inc.
Current  version : 2.0   (September 30, 2014)
Typing : dynamic
Influenced by: Clipper , dBASE
Operating system : Windows
License : proprietary
Alaska software

Xbase ++ is a programming language for 32-bit and 64-bit platforms from Alaska Software Inc. It can be used procedurally as well as object-oriented, whereby the clear strengths lie in object orientation .

Range of functions

Xbase ++ 2.0 Workbench with sample project

Xbase ++ is equipped with an internal instruction set for working with dBASE or FoxPro databases , which is why no additional drivers (including ODBC ) or DBMS are required for working with DBF files . Xbase ++ offers complete integration of all common Windows forms, which are encapsulated as objects within the program code. All object-oriented approaches are supported in Xbase ++ (single and multiple inheritance, abstract classes, abstract methods ...). There is no support for standard network protocols (except NetBIOS ) such as TCP / IP in the standard language or in the runtime libraries supplied , but this can be compensated for by numerous additional products. There is also a large number of additional libraries with which, for example, e-mail functionality via SMTP and POP3 protocol can be used. Furthermore, you can use the OpenGL interface or access any databases via ODBC . The integration of ActiveX components is just as possible as the use of .Net components. Using a so-called web application adapter , it is possible to support business processes via the Internet and to access dBASE databases directly via the Internet. The result can then be conveniently displayed in any browser or even in your own program interface using ActiveX components. With version 2.0, the web front end was expanded to include the Compiled Xbase Pages class ( <CXP /> ), with which the familiar Xbase ++ logic, embedded in HTML code for the user interface, can be used. These pages can then be accessed from a web server using any browser ; only the created program DLL must be on a Windows server .

In addition to the command line commands, Alaska provides licensees with the free tool Visual Xbase ++ for development up to and including version 1.9 SL1 . From version 2.0 the IDE is made available as a central development environment under the name Workbench .

Versions

  • Xbase ++ 1.82, March 2003
  • Xbase ++ 1.9, May 2006
  • Xbase ++ 1.9 SL1 (build level 1.90.355), April 2009
  • Xbase ++ 2.0, September 30, 2014, updates as part of the continuous delivery strategy on:
    • 09/30/2014 (Build 554)
    • 10/13/2014 (Build 556)
    • 11/10/2014 (Build 560)
    • 12/16/2014 (Build 570)
    • 02/24/2015 (Build 575)
    • 08/18/2015 (Build 623)
    • 05/11/2015 (Build 644)
    • 11/13/2015 (Build 656)
    • ...
    • 06/15/2020 (Build 1255)

Position in the market

Xbase ++ is not as popular as other products such as C ++ , Visual Basic or C # . A major disadvantage arises directly from the relatively low penetration of the market with products in this language, which inevitably affects the developer. That is because information material is not available for his work to the extent that is the case with the "major" languages ​​and many things, such as the additional functions described above, often have to be bought from other providers for a lot of money, while these in the far common languages ​​are already part of the basic equipment.

The manufacturer xHarbour offers a competing project to Xbase ++.

Xbase ++ is compatible with Clipper , which is a port allows Clipper programs in the 32-bit Windows world and in the browser world. With version 2.0, a migration option from Microsoft Visual FoxPro code has also been offered since 2014 . However, this has only been implemented to a rudimentary extent; the aim is to achieve full transfer options with Xbase ++ 3.0.

Disadvantage of Xbase ++

It is not possible to work with Xbase ++ in a component-based and cross-language manner. You can use DLLs written in C ++ or Visual Basic, but vice versa you cannot create DLLs with Xbase ++ that can be used from other languages.

Another disadvantage is that this language does not correspond to an internationally recognized standard, but is specified by a single company and developed in a proprietary manner (as is also the case with Visual Basic; however, C ++ is not). With Xbase ++ it is still not possible to develop cross-platform because only Windows and Web are supported as platforms.

Syntax example

The following Xbase ++ 2.0 example source code shows a class whose object instances have only one method with which they collect all files of a certain type in a specified directory, save them in a class variable and display them in a simple message box.

#include "directry.ch"
 // zuerst wird die Klasse definiert
 CLASS FolderScanner
    // Methoden und Member-Variablen global sichtbar machen
    EXPORTED:
       VAR cFilesString
       METHOD ListFilesFromFolder
    // Sichtbarkeit von Member-Variablen und Methoden auf Subklassen einschränken
    PROTECTED:
       VAR cFileExt
       VAR cDirectory
       VAR aFiles
       METHOD Init
       METHOD ShowMessage
 ENDCLASS
 // dann werden die Methoden definiert
 METHOD FolderScanner:Init( cExtension, cDirectory )
    // die bergebenen Variablen cExtension und cDirectory werden automatisch als LOCAL definiert
    LOCAL cErrorTxt := "" // bei der Deklaration können Werte zugewiesen werden
    ::cFileExt := ""
    IF VALTYPE( cExtension ) == "C" .AND. .NOT. EMPTY( ALLTRIM( cExtension ) )
       ::cFileExt := ALLTRIM( cExtension )
    ENDIF
    // Kontrollstruktur für Fehler-Management einleiten
    BEGIN SEQUENCE
    IF VALTYPE( cDirectory ) == "C" .AND. .NOT. EMPTY( ALLTRIM( cDirectory ) )
       // es darf ohne weiteres Instanzvariablen mit dem gleichen Namen geben
       ::cDirectory := ALLTRIM( cDirectory )
    ELSE
       break( "Kein Pfad zum Durchsuchen angegeben. Abbruch" )
    ENDIF
    IF .NOT. FILE( ::cDirectory, "D" )
       break( "Das Verzeichnis '"+ ::cDirectory + "' existiert nicht. Abbruch" )
    ENDIF
    ::aFiles := {}
    ::cFilesString := ""
    RECOVER USING cErrorTxt
       ::ShowMessage("Achtung", cErrorTxt ) // Problem anzeigen
       QUIT // und Schluss
    END SEQUENCE // Ende der Kontrollstruktur
 RETURN self
 METHOD FolderScanner:ListFilesFromFolder()
    ::aFiles := DIRECTORY( ::cDirectory+"\"+"*." + ::cFileExt )
    ::cFilesString := ""
    AEVAL( ::aFiles, { |aFile, i| ::cFilesString += CHR(13)+CHR(10) + aFile[F_NAME]} )
    ::ShowMessage("Ergebnis", ;
                "Zur Datei-Extension " + ::cFileExt +    ;
                " wurden folgende Dateien im Verzeichnis '"+ ;
                ::cDirectory +"' gefunden : " + ::cFilesString )
 RETURN self
 METHOD FolderScanner:ShowMessage(cCaption, cMessage)
    MSGBOX( cMessage, AppName()+": " + cCaption )
 RETURN self
 // So kann die Klasse verwendet werden
 PROCEDURE Main() // 'Main' ist der Standard-Bezeichner für die Haupt- bzw. Startroutine
    LOCAL oFolderscanner
    oFolderscanner := Folderscanner():New( "EXE", "E:\TEMP" )
    oFolderscanner:ListFilesFromFolder()
 RETURN

Web links