Você está na página 1de 4

12/ 3/ 12

Li er t y BASI C - Wi i edi , t he f r ee encycl pedi b kp a o a

Liberty BASIC
From Wikipedia, the free encyclopedia

Liberty BASIC (LB) is a commercial computer programming language and integrated development environment (IDE). It has an interpreter developed in Smalltalk, which recognizes its own dialect of the BASIC programming language. It runs on 16- and 32-bit Windows and OS/2.

Liberty BASIC
Paradigm(s) Appeared in Designed by Developer Event-driven, Procedural 1992 Carl Gundel Shoptalk Systems 4.04 (July 31, 2010)

Contents
1 Background 2 Features 2.1 Distinguishing features 3 Notable programs written in Liberty BASIC 4 Example code 5 Alternative implementations 6 See also 7 External links

Stable release

Typing discipline Dynamic, weak Run BASIC, GLBCC Major implementations Influenced by Influenced OS License Usual filename extensions QuickBASIC, Smalltalk/V Just BASIC, Leopard Microsoft Windows (Mac OS X, and Linux in Liberty Basic 5) Commercial .bas, .fr3 libertybasic.com (http://www.libertybasic.com/)

Background

Website

Liberty BASIC was written by Carl Gundel and published in its first release by his company, Shoptalk Systems, in 1992. It has progressed steadily since then. The last published update to the software was in 2006. The current version is v4.04. Liberty BASIC has been used in examples of code for various guides and references about programming in Windows, including "Beginning Programming For Dummies", by Wallace Wang. Though Liberty BASIC has its share of limitations in its design for advanced The Liberty Basic v4.03 IDE programming, it makes a credible and very usable introductory integrated system development environment, IDE, for moderate to advanced users of Windows and OS/2. DLLs are available with functions allowing users to overcome most of the limitations in Liberty BASIC. The OS/2 version is very old, but free. A new version that will run on Windows, Macintosh and Linux is in active development. The Liberty BASIC dialect, and IDE, have developed a market niche for introductory and intermediate programmers who are learning the skills of programming, though it has been less widely adopted as a commercial publishing product. This does not mean that Liberty Basic is educational software only. It is still a commercial product, and can be used to create proprietary software.

en. w i edi . or g/ w i Li er t y_BASI C k ip a k i/ b

1/ 4

12/ 3/ 12

Li er t y BASI C - Wi i edi , t he f r ee encycl pedi b kp a o a

In its current version, it runs only on Microsoft Windows, but version 5 is in active development and runs on Mac OS X and Linux systems as well. Liberty Basic is not a true compiler. Liberty Basic translates the code written in the IDE to an encrypted (not 'tokenized') file with the extension "tkn". This file is then interpreted by an executable file that carries the same file name, although this may change with the release of version 5.

Features
A visual development tool called FreeForm, written in Liberty BASIC and greatly extended by the Liberty BASIC community over the years Source level debugger calling of DLLs and APIs Color graphics capability Can create games with sprite animation, sound, music, and joystick control Liberty Basic v4.03 running on An add-on package called Assist with many new features, such as a Linux with Wine code formatter, source code versioning, a performance profiler, an easy-to-use code difference browser, and an improved package and deployment system

Distinguishing features
Liberty BASIC allows for programming in a style similar to DOS BASICs that run in console mode, using a default "main window" that displays formatted text and accepts user input. It also supports GUI-based event-driven programming using several types of windows that may contain the standard controls such as buttons, menus, textboxes, etc. A central idea in creating Liberty BASIC was to model the handling of windows after the syntax for file handling. For example, (from the Liberty BASIC Help File): "The OPEN command opens communication with a device, which can be a disk file, a window, a dynamic link library or a serial communications port."
OE dvc FRproeA #ade{E =n PN eie O ups S hnl LN }

This general purpose syntax is one of the features of LB that make it easier to learn. Once a device is open, data and also commands to control that device can be printed to it. For each type of device there is a set of commands which can be sent to it in this way. In the more recent versions of LB the word "print" may be dropped from the "print" statement, making the syntax even simpler. Simplicity has been at the heart of Liberty BASIC from the beginning. This makes it easier to learn but at some cost, perhaps, in limiting functionality. Only two data types are supported in LB4.03: numeric and string. No type declarations are required: any variable with a $ sign at the end of its name is a string variable; otherwise it is numeric. (The plan for LB5 is to support other types and user defined types as well as these.) For the purpose of making calls to API or 3rd party DLLs there is a STRUCT and the additional types necessary for the DLL. The
en. w i edi . or g/ w i Li er t y_BASI C k ip a k i/ b 2/ 4

12/ 3/ 12

Li er t y BASI C - Wi i edi , t he f r ee encycl pedi b kp a o a

only other data structure currently supported is the ARRAY. Arrays of one or two dimensions are supported. LB5 may support arrays of user-defined types.

Notable programs written in Liberty BASIC


FreeForm, a GUI Editor was written in LB for easily creating simple or complicated GUI formats

Example code
Here are some examples of the language: "Hello world" program:
pit"el wrd rn hlo ol" ed n

Program to display a pop-up message box with the words "Hello, World!" on it:
nmiwn oani ntc "el wrd" oie Hlo ol! ed n nmiwn oani ntc "xml porm +cr(3 +"el wrd" oie Eape rga" h$1) Hlo ol! ed n

Program to display an input box:


nmiwn oani pop "ne yu nm:;epne rmt Etr or ae"rsos$ ntc "epne" cr(3 +epne oie Rsos:+ h$1) rsos$ ed n

Running another application using Liberty BASIC:


nmiwn oani rn"oea.x" u ntpdee ed n

Printing multiplication table of 5 on form:


[ut] mli fri=1t 1 o o 0 rs=5*i e pitrs rn e nx i et ed n

Alternative implementations
en. w i edi . or g/ w i Li er t y_BASI C k ip a k i/ b 3/ 4

12/ 3/ 12

Li er t y BASI C - Wi i edi , t he f r ee encycl pedi b kp a o a

In 2011 an alternative Windows implementation of Liberty BASIC, LB Booster (LBB), became available. Although substantially compatible with the Liberty BASIC 4 language syntax, LBB was developed entirely independently by Richard Russell and is written in BBC BASIC. LBB offers (typically) increased execution speed, smaller self-contained executables and some additional capabilities. However LBB is not 100% compatible with LB4 and whilst many programs will run without modification some may need to be adapted, or even be unsuitable for running under LBB.

See also
Liberty BASIC Workshop (an add-on IDE for Liberty BASIC) Just BASIC (a freeware version of Liberty BASIC) Run BASIC (a free-to-use web programming site based on Liberty BASIC)

External links
Liberty BASIC (http://www.libertybasic.com) Official Support Group (http://groups.yahoo.com/group/libertybasic/) Carl Gundel's blog (http://basicprogramming.blogspot.com/) Liberty BASIC Wiki (http://basic.wikispaces.com/) Liberty BASIC Programmer's Encyclopedia (http://lbpe.wikispaces.com/) Liberty BASIC CommunityForum (http://libertybasic.conforums.com) Liberty BASIC on Rosetta Code (http://rosettacode.org/wiki/Category:Liberty_BASIC) LB Booster (http://www.lbbooster.com/) Liberty Basic France (http://libertybasic.fr/) (In French) Retrieved from "http://en.wikipedia.org/w/index.php?title=Liberty_BASIC&oldid=489788463" Categories: BASIC programming language family BASIC interpreters This page was last modified on 29 April 2012 at 14:24. Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. See Terms of Use for details. Wikipedia is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.

en. w i edi . or g/ w i Li er t y_BASI C k ip a k i/ b

4/ 4

Você também pode gostar