Description
KBasic is an open source project backed by years of continual development. It comes with Java�-like object orientation and backward support for VB6 and QBasic�, as it is 100% syntax compatible, but it is not a VB6 or VB.NET� clone! Though it comes with support for VB.NET� syntax, functions and similar objects and classes as well. KBasic combines the expressive power of Object-Oriented languages like C++ with the familiarity and ease of use of VB6. It allows developers with an installed base of VB6 applications to start developing for a mixed Windows�, Mac� OS X and Linux� environment without having to face a steep learning curve: KBasic uses the familiar visual design paradigm and has a full implementation of the BASIC language.
KBasic is made up of the following programs:
-
a development environment with visual form designer (IDE)
-
a compiler (KBC)
-
an interpreter (VM)
-
a graphical user interface component. (VM)
It�s about 15 MB source codes (C++)
It is really easy to develop multi-platform GUI applications with well known BASIC syntax in a modern fashion, because KBasic uses the familiar visual design paradigm and has a full implementation of the BASIC language. KBasic uses Qt� to provide cross-platform functionality (Qt� is the leading cross-platform technology available worldwide).
Feature Overview
On the following sections you will get know KBasic. Though I cannot describe everything in detail like in a programming book, I will describe some of KBasic�s nature and features at an expert level. Nevertheless if you know C++, VB6 or similar BASICs or Java� you will not have difficulties to get along with KBasic. It shares many concepts of those programming languages.
The KBasic Book: this book contains detailed information about KBasic. You can find it in KBasic Software Atelier in the menu �Help�. So if you are interested in a line-by-line coverage please refer to The KBasic Book.
-
Write once and deploy native applications for Windows�, Mac� OS X and Linux�
-
OOP RAD features deliver high productivity
-
Much cheaper than other BASIC�s
-
�backward� support for VB6 and �forward� support for inheritance and other OOP features
-
do it on multiple platforms
-
Porting existing VB6 projects is easy, because KBasic is 100% syntax compatible
-
Familiar development process, environment
-
Same syntax as VB6
-
Easy to learn: built-in Tips and language reference
-
Be more productive with OOP RAD features
-
Built-in memory management via reference counting
-
True cross-platform deployment
-
Familiar language features: OOP, single inheritance, exceptions, etc.
-
Drag & drop GUI development
-
Rich UI widgets set
-
Familiar editing features: easy and fast browsing of your source code
-
Familiar editing features II: Auto-Completion of builtin-functions and datatypes, even user defined functions and types
-
Auto-Completion (Professional version only)
-
Familiar debugging features: single step, showing variables� values, local and global scope
-
Familiar Install/Uninstall features: for Linux� (KDE), Mac� OS X and Windows�
Lots of Documentation!
KBasic comes with extensive documentation, with hypertext cross-references throughout, so you can easily click your way to whatever interests you. The part of the documentation that you will probably use the most is the KBasic Language Reference. Each link provides a different way of navigating the KBasic Language Reference; try them all to see which work best for you. You might also like to try The KBasic Book: this book contains detailed information about KBasic, and it provides a full text search facility. There are also a growing number of KBasic books.
Thousands of examples!
KBasic ships with lots of small and some medium-sized example programs that teach you how to implement various tasks with KBasic. Most of them will show how to use a certain class or module, others aim at programming techniques and KBasic basics, and some of them simply want to show you what is possible.
Note that most of the examples assume that you have some experience with KBasic and Object-Oriented programming and therefore are not commented extensively. If you are interested in a line-by-line coverage please refer to the �Learning Coding for Beginners� and �The KBasic Book�.
Feature Detail
KBasic is object oriented with objects and classes, single inheritance and polymorphism and private, public, protected scope of objects� elements
KBasic is syntax compatible to old BASICs like QBasic� or VB6
-
optional parameter
-
paramarray
-
named arguments [mySub(param1 := 23, param2 := 100)]
-
on error goto
-
label and goto
-
variable naming (with shortcuts like name$ or n%)
-
property handling
-
primitive variables also arrays and user defined types can be passed to functions by reference
KBasic contains a virtual machine
-
automatic garbage collection
-
protected data and arrays
-
modern error management through exception handling
KBasic is not only one programming language but is also three languages.
Through one of the following command you can switch KBasic into one mode.
- If you want to use KBasic newest features (Default) use
OPTION KBASIC
- If you want to use old VB6 code use
OPTION OLDBASIC
- For very old BASIC code like QBasic you should use:
OPTION VERYOLDBASIC
It is possible to use all three modes in one of your program, e.g. one module uses one mode and the other module of your program use another mode. Just place one of these lines in top of your module. Default is OPTION KBASIC.
Of course like other programming languages, KBasic comes with commands for control flow, conversion/casts, error handling, events and library functions like for gui, input or output, maths and so on. See the language reference for more. But besides this you should be familiar with the following main parts.
-
Class / Module
-
Sub / Function / Method
-
Variable / Constant / Property
-
Array
-
Type
-
Enum
If you start working on your first KBasic program keep in mind that is very similar to VB6. You have modules or classes and forms, which work together. Events in your forms are triggered by the user and you can react to them within your program inside its subs. That�s it.
Annotations
-
Type
-
Variable / Constant / Property
-
Variable Scope
-
global
-
module
-
class
-
local
-
module function or module sub
-
class static method
-
class instance method
Array
Sub / Method
-
default arguments
-
arguments by reference or by value depending on primitive type are possible
-
function overloading possible
-
recursive calls are possible
-
non-primitive local variables (objects) will not be automatically destroyed if there is a reference to it
-
exception handling
Function / Method
-
default arguments
-
arguments by reference or by value depending on primitive type are possible
-
function overloading possible
-
recursive calls are possible
-
(user defined types and arrays can be returned as well (in the future))
-
non-primitive local variables (objects) will not be automatically destroyed if there is a reference to it
-
exception handling
Scope
module
class static
class instance
local
class static
class instance
Class
-
Constructor (method overloading possible)
-
Default Constructor (automatically called if there is no constructor defined)
-
Destructor (automatically called by garbage collector)
-
instance methods (works on variables of an object of a class)
-
static methods (works without any relation to an object)
-
instance variables (private, public, protected), variables of an object of a class
-
static variables (works without any relation to an object)
-
static source code part of class (will be executed on start up of your program)
-
static constants
-
property support
-
variables (private, protected, public)
-
constants (private, protected, public)
-
types / enum can be private or public
-
all methods are �virtual� (speaken in C++ terminology), which means that the child method is called by parent class instead the original parent method which was overwritten by the child class
Module
-
subs or functions
-
variables (private, public)
-
constants (private, public)
-
types / enum can be private or public
Global
-
subs or functions
-
variables
-
constants
-
types / enum
|