English | German | Spanish | French | Italian | Portugese | Japanese | Korean | Chinese |

  KBASIC'S FEATURES

  Full featured

  Object oriented

  Modern BASIC language

  Full featured IDE

  Complete documentation

  DESCRIPTION

It comes with truly Java-like object orientation and backward support for VB6 and QBasic, as it is 100% syntax compatible, but it is not a VB6 clone! 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
- a menubar/toolbar designer
- a compiler
- an interpreter
- an archiver
- a graphical user interface component.

It is possible to develop GUI applications with well known BASIC syntax in a modern fashion. It comes with truly Java-like object orientation and backward support for VB6 and QBasic, as it is 100% syntax compatible. 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.

Your opportunities

Include KBasic: If you are a publisher of a Linux operating system, please contact us at info@kbasic.com. We are interested in shipping KBasic Personal Edition or Professional Edition in your Linux distribution. You can include KBasic Personal Edition in your Linux product for free.


Sell KBasic! If you are a seller of Windows or Linux Software, please contact us at info@kbasic.com. We are interested in having KBasic Professional Edition in your Windows or Linux Software Shop. You can get KBasic Professional for a lower price.


Translate for KBasic! If you are a native speaker of a language, which is not yet translated, you can translate “The KBasic Book” and will get the right to sell your translation of “The KBasic Book” together with KBasic Personal Edition for any price in any country; please contact us at info@kbasic.com.


Language Specification

Keywords

$Dynamic #Else $End #ExternalSource #If #Region $Static Absolute Abstract AddressOf Alias Ansi As Assembly Auto Base ByRef ByVal Call CallByName Case Catch CBCD CEXT CFIX Chain Choose Class Class_Initialize Class_Terminate COM Command Common Compare Const Constructor CQUD CreateObject Data Database Decimal Declare Def Default DefBool DefByte DefCur DefDate DefDbl DefInt DefLng DefObj DefSng DefStr DefVar Delegate Destructor Dim DirectCast Do Each Else ElseIf Empty End EndIf Enum Environ Environ$ Erase ErDev ERL ERR Event Exit Explicit Extends Finally FN For Friend Function Global GoSub GoTo Handles If IIf Implements Imports In Inherits Interface Is Iterate KBasic Key LBound Let Lib Like LoadResString Loop LSet Me Mid Module MustInherit MustOverride MyBase MyClass NameSpace New Next Nothing NotInheritable NotOverridable Null Off On Option Optional Overloads Overriddable Overrides ParamArray Parent Pen Play Preserve Private Property Protected Public VeryOldBasic RaiseEvent Range Read ReadOnly ReDim Rem /* /** ' Repeat Restore Resume Return RSet Run Select Set Shadows Shared Short Signal SizeOf Slot Static Step Stop STRIG Structure Sub Swap Switch SynClock System Text Then Throw Throws Timer To TROFF TRON Try Type TypeDef UBound UniCode Until VARPTR VARPTR$ VARSEG OldBasic Wait Wend While With WithEvents WriteOnly


Builtin functions

__Class__ __Line__ __Module__ __Scope__ __Sub__ Abs Access Acs AddHanlder AppActiviate Append Array Asc Asn Atn Beep Bin Bin$ Binary BLOAD BSAVE CBool CByte CChar CCur CDate CDbl CDec ChDir ChDrive Chr Chr$ CInt Circle Clear CLng Close CLS CObj Color Command$ Cos CShort CSng CsrLin CType CurDir CurDir$ CVar CVD CVDMBF CVERR CVI CVL CVS CVSMBF Date Date$ DateAdd DateDiff DatePart DateSerial DateValue Day DDB Deg DeleteSetting Dir Dir$ DoEvents DOF Draw EOF ErDev$ Error Error$ Exp Fact Field FileAttr FileCopy FileDateTime FileLen Files Filter Fix Format Format$ FormatCurrency FormatDateTime FormatNumber FormatPercent Frac FRE Free FreeFile FV Get GetAllSettings GetAttr GetAutoServersettings GetObject GetSetting GetType Hex Hex$ Hour Hypot IMEStatus Inkey Inkey$ Inp Input InputBox InStr InStRev Int IOCtl IOCtl$ IPMT IRR IsArray IsBoolean IsByte IsCharacter IsCollection IsCString IsCurrency IsDate IsDouble IsEmpty IsError IsInt16 IsInt32 IsInt64 IsInteger IsMissing IsNull IsNumeric IsObject IsShort IsSingle IsUInt16 IsUInt32 IsUInt64 Join Kill LCase LCase$ Left Left$ Len Line LN Load LoadPicture LoadResData LoadResPicture Loc Locate Lock LOF Log Logb LPos LPrint LTrim LTrim$ Max Mid$ Min Minute MIRR MKD$ MkDir MKDMBF$ MKI$ MKL$ MKS MKS_ MKSMBF$ Month MonthName MsgBox MTIMER Name Now NPER NPV Nz Oct Oct$ Open Out Output Paint Palette Partition PCopy Peek PMAP PMT Point Poke Pos PPMT Preset Print PSet Put PV QBCOLOR Rad Raise RaiseSignal RaiseEvent Random Randomize Rate RemoveHandler Replace Reset RGB Right Right$ RmDir RND Round RTrim RTrim$ SavePicture SaveSetting Screen Sec Second Seek Seg SendKeys SetAttr Sgn Shell Sin Sleep Sln Sound Space Space$ Spc Split Sqr Stick Str Str$ StrComp StrConv String String$ StrReverse SYD Tab Tan Time Time$ TimeSerial TimeValue Trim Trim$ TypeName TypeOf UCase UCase$ UnLoad UnLock Using Val VarType View Weekday WeekdayName Width Window Write Year


Operators

<< Shl >> Shr Inc ++ Dec -- += -= /= *= |= &= BitAnd BitOr BitXor BitNot + - * / Mod = <> >= <= > < And AndAlso Or OrElse Not ^ & Xor \ Eqv Imp


Datatypes

Boolean Byte Character Collection CString Currency Date Double Int16 Int32 Int64 Integer Long Object Short Single String UInt16 UInt32 UInt64 Variant


It's about 5 MB source codes (C++)

130,000 program lines 100 classes 2,500 methods in 280 files


Implementation files


application.cpp bytearray.cpp cpp_parser.cpp cpp_scanner.cpp cpp_token.cpp interpreter.cpp interpreter_builtin_binding.cpp interpreter_builtin_function.cpp interpreter_builtin_sub.cpp interpreter_control.cpp interpreter_expression.cpp interpreter_ext.cpp interpreter_interface.cpp interpreter_kbasic_binding.cpp interpreter_kde_binding.cpp interpreter_main.cpp interpreter_parameter.cpp kbasic.cpp kbasic.math.cpp kbasic_math.cpp kbasic_string.cpp main.cpp memory_class.cpp memory_const.cpp memory_enum.cpp memory_gc.cpp memory_interface.cpp memory_label.cpp memory_module.cpp memory_property.cpp memory_stringliteral.cpp memory_structure.cpp memory_sub.cpp memory_type.cpp memory_variable.cpp misc.cpp parser.cpp parser_builtin_function.cpp parser_builtin_sub.cpp parser_control.cpp parser_expression.cpp parser_ext.cpp parser_interface.cpp parser_kbasic.cpp parser_main.cpp pcode.cpp scanner.cpp stack.cpp todo.cpp token.cpp typedef.cpp utility.cpp _application.cpp _assistant.cpp _checkbox.cpp _class.cpp _clipboard.cpp _collection.cpp _color.cpp _colordialog.cpp _combobox.cpp _commandbutton.cpp _control.cpp _cursor.cpp _debug.cpp _desktop.cpp _event.cpp _expressioneditor.cpp _file.cpp _filedialog.cpp _font.cpp _fontdialog.cpp _form.cpp _frame.cpp _help.cpp _iconview.cpp _image.cpp _kbasic.cpp _key.cpp _label.cpp _listbox.cpp _listview.cpp _mainwindow.cpp _mainwindow_events.cpp _math.cpp _menu.cpp _menubar.cpp _module.cpp _mouse.cpp _mousecursor.cpp _object.cpp _option.cpp _optionbutton.cpp _optionwindow.cpp _os.cpp _printdialog.cpp _printer.cpp _progressbar.cpp _projectwindow.cpp _propertyform.cpp _propertywindow.cpp _regexp.cpp _scrollbar.cpp _scrollview.cpp _signal.cpp _sourcecodeeditor.cpp _statusbar.cpp _textarea.cpp _toolbar.cpp _toolbox.cpp _toolboxform.cpp _toolboxwindow.cpp _welcome.cpp _workspace.cpp


Header files

application.h bytearray.h console.h const.h cpp_parser.h cpp_scanner.h cpp_token.h interpreter.h interpreter_builtin_function.h interpreter_kbasic_binding.h interpreter_kde_binding.h interpreter_parameter.h kbasic.h kbasic.math.h kbasic_math.h kbasic_string.h memory_class.h memory_const.h memory_enum.h memory_gc.h memory_interface.h memory_label.h memory_module.h memory_property.h memory_stringliteral.h memory_structure.h memory_sub.h memory_type.h memory_variable.h misc.h parser.h parser_builtin_sub.h parser_kbasic.h parser_kbasic_binding.h parser_kde_binding.h parser_qapplication.h parser_qwidget.h pcode.h pcode_kbasic_binding.h pcode_kde_binding.h resource.h scanner.h stack.h todo.h token.h typedef.h utility.h _application.h _assistant.h _checkbox.h _class.h _clipboard.h _collection.h _color.h _colordialog.h _combobox.h _commandbutton.h _control.h _cursor.h _debug.h _desktop.h _event.h _expressioneditor.h _file.h _filedialog.h _font.h _fontdialog.h _form.h _frame.h _help.h _iconview.h _image.h _kbasic.h _key.h _label.h _lbal.h _listbox.h _listview.h _mainwindow.h _math.h _menu.h _menubar.h _module.h _mouse.h _mousecursor.h _object.h _option.h _optionbutton.h _optionwindow.h _os.h _printdialog.h _printer.h _progressbar.h _projectwindow.h _propertyform.h _propertywindow.h _regexp.h _scrollbar.h _scrollview.h _signal.h _sourcecodeeditor.h _statusbar.h _textarea.h _toolbar.h _toolbox.h _toolboxform.h _toolboxwindow.h _welcome.h _workspace.h



Feature Overview

On the following pages 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'. It is included as pdf file and html file. 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 / the Personal Edition is free

  • "backward" support for VB6 and “forward” support for inheritance and other OOP features

  • do it on multiple platforms



Pic1: Project Window




  • 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



Pic2: Screen



  • Low price

  • Be more productive with OOP RAD features

  • Built-in memory management via reference counting

  • True cross-platform deployment



Pic3: Form Designer with Properties and Toolbox



  • Familiar language features: OOP, single inheritance, exceptions, etc.

  • Drag & drop GUI development

  • Rich UI widgets set



Pic4: Source Code Editor with syntax highlighting



  • Familiar editing features: easy and fast browsing of your source code




Pic5: Source Code Browser: Lists Functions and Subs and other elements of your programs (Professional version only)



  • Familiar editing features II: Auto-Completion of builtin-functions and datatypes




Pic6: Auto-Completion (Professional version only)



  • Familiar debugging features: single step, showing variables' values, local and global scope



Pic7: Debug Mode (Professional version only)





  • A 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.



Pic9: The KBasic Book



  • 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.



Pic10: Example list



  • Familiar Install/Uninstall features: for Linux (KDE), Mac OS X and Windows



Pic11: Easy Installation of KBasic Software Atelier







Feature Detail

KBasic




       is object oriented with objects and classes, single inheritance and polymorphism and private, public, protected scope of objects' elements


PicA: Objects and Classes



PicB: Polymorphism



       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


PicC: On Error GoTo




       contains a virtual machine

    • automatic garbage collection

    • protected data and arrays

    • modern error management through exception handling



PicE: Virutal Machine Info




KBasic is not only one programming language but also three

Through one of the following command you can switch KBasic into one mode.

If you want to use KBasic newest features 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

       Collection / Array

       Type ( / Structure)

       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 ( / Structure (in the future))



       Variable / Constant / Property



       Variable Scope


    • global

    • module

    • class

    • local

           module function or module sub

        • (block scope (in the future))

           class static method

        • (block scope (in the future))

           class instance method

        • (block scope (in the future))




       Array


    • static

    • dynamic





       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


    • global

    • module

    • class static

    • class instance

    • local

           module

           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




Copyright ©2006 KBasic Software

Products named on this website are trademarks of their respective owners.