WxBasic

WxBasic

Infobox Software
name = wxBasic



caption =
collapsible =
author =
developer =
released =
latest release version = 0.52
latest release date = March 22, 2002
latest preview version =
latest preview date =
frequently updated =
programming language =
operating system = Cross-platform
platform =
size =
language =
status =
genre =
license = GNU Lesser General Public License
website = http://wxbasic.sourceforge.net/

wxBasic is a free software / open-source software, cross-platform BASIC interpreter. As it is based on the easy-to-use syntax of the BASIC language, it is simple to learn and understand, allowing even novice programmers to write nice-looking applications for graphical environments like Windows and Linux with minimal effort. As of September, 2004, the software is in a beta state, but it is effective enough for hobby programming.

It can create stand-alone executables by binding together source code with the interpreter. In contrast with executables created by similar commercial programs like Visual Basic, executables produced by wxBasic do not require any external DLL file, resource file, or installer to run. The executable is distributed alone and can be run immediately by end users. As with programs written in any interpreted language, wxBasic programs may also be run straight from the source code if wxBasic is present on the system, regardless of which system they were written on. This saves download time, as generated executables tend to be several orders of magnitude greater than the source code from which they were compiled.

wxBasic is written primarily in C, with some C++ linking it to the wxWidgets library. wxWidgets supplies the cross-platform features, making wxBasic a very powerful, although beginner-friendly, programming language.

wxBasic runs on Windows using native controls, and Linux using the GTK+ Library. A Macintosh port is being actively investigated.

wxBasic is a bytecode based language, like Perl or Java.

It is licensed under the LGPL, so proprietary code can be linked against it.

Comprehensive example

To give an idea how the syntax looks like see the following program which implements a text viewer:

' from http://wxbasic.sourceforge.net/phpBB2/viewtopic.php?t=554 ' Simple Text Viewer written in wxBasic dim AppName = "Text Viewer" fileName = ""

' Main window dim frame = new wxFrame( Nothing, -1, AppName & " - Untitled Document" ) ' Text edit control dim control = new wxTextCtrl( frame, -1, "", wxPoint( 0, 0 ), wxSize( 100, 100 ), wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH)

' Status bar - The one at the bottom of the window dim status = frame.CreateStatusBar( 1 ) frame.SetStatusText("Ready") ' ' Dialog used for Open dim fileDialog = new wxFileDialog( frame ) ' ' add menubar to the frame dim mBar = new wxMenuBar() frame.SetMenuBar(mBar) ' ' build the "File" dropdown menu dim mFile = new wxMenu() mBar.Append(mFile, "&File")

' make it ' mFile.Append( wxID_OPEN, "&Open...", "Loads an existing file from disk" ) ' mFile.AppendSeparator() mFile.Append( wxID_EXIT, "E&xit Alt-X", "Exit Application" )

Sub onFileOpen( event ) fileDialog.SetMessage("Open File") fileDialog.SetStyle( wxOPEN ) If fileDialog.ShowModal() = wxID_OK Then fileName = fileDialog.GetPath() Ext = fileDialog.GetFilename() control.Clear() control.LoadFile( fileName ) frame.SetTitle( AppName & " - " & fileName ) frame.SetStatusText(Ext) End If End Sub ' Connect( frame, wxID_OPEN, wxEVT_COMMAND_MENU_SELECTED, "onFileOpen" )

Sub onFileExit( event ) frame.Close(True) End Sub ' Connect( frame, wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, "onFileExit" )

' build the "Help" dropdown menu dim mHelp = new wxMenu() mBar.Append(mHelp, "&Help") mHelp.Append( wxID_HELP, "&About F1", "About this program" ) ' Sub onHelpAbout( event ) Dim msg = "Text View allows any text file " & "to be viewed regardless of its extension. " & "If the file being opened isn't a text file " & "then it won't be displayed. There will be a " & "little garbage shown and that's all." wxMessageBox( msg, "About Text View", wxOK + wxICON_INFORMATION, frame ) End Sub Connect( frame, wxID_HELP, wxEVT_COMMAND_MENU_SELECTED, "onHelpAbout" )

frame.Show(True)

External links

* [http://wxbasic.sourceforge.net/ wxBasic Home Page]
* [http://wxbasic.sourceforge.net/phpBB2/index.php wxBasic Forum]
* [http://wiki.wxwidgets.org/wiki.pl?WxBasic_Tutorial WxBasic tutorial]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • WxBasic — est un logiciel libre / open source, multi plateformes interpréteur BASIC reposant sur wxWidgets[1]. Il permet de créer dans une variant de Basic des programmes à interface graphique portables sur Windows et Linux et est distribué selon les… …   Wikipédia en Français

  • wxBasic — est un logiciel libre / open source, multi plateformes interpréteur BASIC reposant sur wxWidgets[1]. Il permet de créer, dans une variante de Basic, des programmes à interface graphique portables sur Windows et Linux et est distribué selon les… …   Wikipédia en Français

  • WxBasic — ist eine Open source Implementierung eines BASIC Interpreters von David Cuny. Die damit erzeugten Programme laufen unter Windows und Linux. Der Interpreter ist im Betastadium. Man kann damit einzelne ausführbare Dateien erzeugen, die keine… …   Deutsch Wikipedia

  • Basicdialekt — Aufgrund der seit Jahrzehnten bestehenden Popularität von BASIC existieren zahlreiche BASIC Implementierungen auf einer Vielzahl von Plattformen. Entsprechend den sehr unterschiedlichen Umgebungen und Einsatzzwecken wurde eine hohe Zahl von… …   Deutsch Wikipedia

  • Basicdialekte — Aufgrund der seit Jahrzehnten bestehenden Popularität von BASIC existieren zahlreiche BASIC Implementierungen auf einer Vielzahl von Plattformen. Entsprechend den sehr unterschiedlichen Umgebungen und Einsatzzwecken wurde eine hohe Zahl von… …   Deutsch Wikipedia

  • List of BASIC dialects by platform — List of BASIC dialects by platform: This is a list of dialects of the BASIC computer programming language, sorted into groups for better conceptual organization.There is also an alphabetical list of BASIC dialects. These two lists should contain… …   Wikipedia

  • List of BASIC dialects — This article gives an alphabetical list of BASIC dialects mdash;a flat list of interpreted and compiled variants of the BASIC programming language. The dialects platform(s) (that is, the computer models and operating systems) are given in… …   Wikipedia

  • SdlBasic — is a multiplatform interpreter for BASIC, using the SDL libraries. Its interpreter core is based on wxBasic. The interpreter can be very useful for people who are familiar with ANSI BASIC interpreters and are curious or needing SDL library… …   Wikipedia

  • Liste der BASIC-Dialekte — Aufgrund der seit Jahrzehnten bestehenden Popularität der Computer Programmiersprache BASIC existieren zahlreiche BASIC Implementierungen auf einer Vielzahl von Plattformen. Entsprechend den sehr unterschiedlichen Umgebungen und Einsatzzwecken… …   Deutsch Wikipedia

  • SdlBasic — ist ein Open Source BASIC Dialekt, der von einem italienischen Programmierer betreut wird. Von wxBasic wurde der Interpreter übernommen, aber statt der wxWidgets Bibliothek die plattformunabhängige Simple DirectMedia Layer Bibliothek eingebunden …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”