XBasic Facts


Differences between XBasic versions maintained by Eddie Penninkhof and versions maintained by Max Reason


It is important to know that there are TWO differently maintained versions of XBasic on the net.

Versions #.#.# by Eddie Penninkhof (aka Eddie-Basic)
Versions #.### by Max Reason (aka Max-Basic)

Currently Max Reason's last official version is V6.0022 and as far as understood, V6.0022 will not be updated anymore (Max has more important business to run) which makes Eddie's V6.2.0 the official latest update and the official maintainer.

Eddie works a bit the common way when releasing versions:

 A lot of documentation at this site is generally directed to Max's V6.0022 but I'm slowly busy to add procedures for Eddie's versions.This also means that support for V6.0022 or lower will be degrading meaning:if I have to replace text, it will be done, whatever info is known for V6.0022 will remain intact but as V6.3.0 is coming (V6.2.0 already having a lot less bugs than V6.0022) it might be a good time to step over to Eddie's version since after a couple of more updates the differences and working method of both versions are starting to range further each update and you might even need to accommodate to switch between Max's last version and Eddie's latest.
One of the biggest advantage with Eddie's version is that you are not obliged to have xbasic stored in the root of a path (C:\XB, D:\XB, E:\XB, etc.)
Second big advantage is that you are not obliged to have your xbasic sources in the same directory where all the binary executables are that assemble and compile your sources.

What am I required to know when writing in XBasic?


The basics for as far as getting started you can find here on these pages.

Docs, Books and confusions
Knowing XBasic I also found out that there are other sites that provide "XBasic" which has nothing to do with Max Reason's development.

There is another XBasic (or CrossBasic) known which has got to do with Alpha Five.
This version of basic is currently known as REALBasic and is developed on Macintosh
Also someone made some kind of translator for a couple of basic versions (something like IDL is for CORBA and COM) which is called XBasic.

Trust me, there are NO available books in the stores that document Max Reason's XBasic
There are a couple of different available document formats online, in HTML, HTML-HELP, RTF, TEXT based or even PDF format and the links you can get either from this site, Yahoo Groups file section or from xbasic.org

Also various examples are available on this site and some XBasic users made an own site which is linked at xbasic.org and if that won't help you should for sure be able to get answer (try the FAQ first!) at Yahoo Groups mailinglist.

There are two "xb.dll" libraries in the XBasic distribution but they are both for different purposes. The XB.DLL which is in the \xb\ path (or xb\bin\ path when working with Eddie's XBasic version) belongs to the PDE or Program Development Environment.
The other one (mostly named to XB\RUN\XB.DLL) has to be distributed with your executables.
But in order to get this library to work you need to rename it to XB.DLL in the path where your compiled executable is stored.
Two most important advises:
Never overwrite the original XB\XB.DLL by copying / moving the XB\RUN\XB.DLL across it else your PDE is gone.
Never distribute the original XB.DLL (to be remembered best as the largest file of the two) with your executable or XBasic itself will be started instead of your program.

XBVARS.BAT (Only applicable for Eddie's versions)
Follow this link

Keywords and examples
Keywords are very important to learn, not only the basic core keywords like PRINT, XLONG, ULONG, OPEN, READ, WRITE, etc. but also function libraries as the file library Xst, the graphics library Xgr the GUI library Xui and the rest.

Xbasic comes with a load of examples that show you a good solution to your first needs.
If that's not enough there are also other persons that have source- examples online that can supply an answer to your questions.
All example source end up with the extension ".x" for the real newcomers that have no clue yet what to load inside it.
Eddie's distribution has a separate directory called DEMO which contains all examples.
Max's version has all examples in the same parent directory where the XBasic binaries are stored.

Know how to use which enclosure signs
I got a question about code that did not work from supplied examples...
Learn where to use parentheses ( ) , quotes " ", brackets [ ] (i sometimes can't keep US English separated from UK English so excuse me from making mistakes and mix-ups here)

Parentheses are used to enclose arguments for statements and functions, often do you need to enclose conditional statements  eg.:
IF (NumberA = = 24) AND (NumberB = = 12) THEN

Quotes are used to enclose literal text and are always involved in STRING matters:
A$ = "Ralph"
PRINT "Hi..."

Brackets are used major in array issues in contradiction to VB / QB where parentheses are used for this object. In fewer cases you enclose a filehandle within such block-quotes to read / write data from/to them.

DIM MyArray[255]
READ [FromFileHandle], A$

Learn the Tree structure of XBasic grid control

It is pretty important you understand how grid control works in XBasic, if you know this matter you can get the hang of the XBasic GUI control pretty well.

Grid control goes in this order:

window - main gridnumber 0
    -kid gridnumber 1   (Eg. Listbox)
        -asset kid gridnumber 0
        -asset kid gridnumber 1
        -asset kid gridnumber 2
        -asset kid gridnumber 3
    -kid gridnumber 2 (Eg Button)
    -kid gridnumber 3 (Eg.Menu)
        -asset kid gridnumber 0
        -asset kid gridnumber 1
        -asset kid gridnumber 2
    -kid gridnumber 4 (Eg. Label)
    -kid gridnumber 5 (Eg. Checkbox)

Show initiative, experiment
When you created a new GUI program, be sure to check out the messages registered in the function called InitGui() function, you have a complete survey on a load of message types you can use to respond on various actions that are sent to your GUI window code functions.

Also don't be afraid to experiment with the sourcefile and notice how things are built up.
Actually I'm repeating a lot of documentation that is already mentioned in the XB html documentation but studying practical examples around will help for sure in getting better in what you do.

Debugging: Keywords in order?
The keywords need to be 100% pure.
Most of the Basic languages have Auto syntax checking AND correction but XBasic has not.
So be sure that when errors occure:

Bad sides of XBasic
I want to stay honest and straight since XBasic is worth to spend your time on but every application has it's downsides, if they are not bad they are limited....

There are also some things you need to prepare yourself for when working with XBasic, this is to learn to build up patience and routinary biorithm of working and stress prevention:

Xbasic sometimes has a a nasty habit to crash with an error (which programming language does not?).
These errors will display in the console-window of XBasic.
In most cases you are still able to save your work, in less funny cases Xbasic will do that in the form of "XB.SAV" so look for that file and rename it to something like "MyBackup.x"
In the most disasterous case it does not save your sourcefile and you won't be able to save it either.
This last case I rarely have experienced but it is never funny. Nevertheless:Make backups and save regularly.

 Illegal or exception errors that are interrupted by the windows platform itself I really only experienced once or twice and this was even in the executable shape of my code.

Silly or unlogical errors
Sometimes XBasic supplies silly errors which are not errors at all.

  CASE "MyBook"

Error Invalid type: CASE "MyBook"

Well, a$ is a string and there is nothing wrong with comparing "MyBook" to a$.
Why is it complaining then?

When you enter a large block of code, sometimes this addressing locations in XBasic gets poluted when running it from the PDE and stopping it everytime again.

To solve this transport your sourcecode to TextMode by entering the dotcodes ".fm t" and then back to program mode ".fm p".

There is no GUI program since GUI program is only used to set the initial GUI structures, values and constants to work as GUI. But actually XBasic interprets all your sourcecode as Program mode.

Finishing state of XBasic and limitations
XBasic is not as far developed as Visual Basic. For sure it has capabilities to become more powerfull than Visual Basic as the default functions are strong enough to catch up to the current status of Visual Basic.
No you won't find very big OCX libraries and fat plugins to add to your code but you can connect to other DLL libraries and you can create database support if you know the specifications, you can also expand the toolkit with own gadgets but it requires a bit more steps and actions than Visual Basic does, however when designing certain algorithms, I am sure that you can achieve a lot of things much quicker in XBasic than you will be able to do so in VB/QB.

I think that XBasic will never be finished as of it's documentation is not finished but it is good enough to produce some conductive applications with and for a freeware program that is released WITH it's sourcecode you should consider the value of putting your effort into XBasic either to enhance it for own or global purposes or just making applications for other people that will enjoy the pleasure of your program not only in Windows or Linux but also on other platforms that emulate Windows or Linux.

If you start complaining about the lack of features or functions you are not worth to work with a freeware application that has been build up in literally a couple of ten thousand hours of work considering that the creator Max Reason started with it around 1992/1993 count that devotion up to 2000 and consider what you turn down or be negative about.

Just be enthousiastic instead and build along, you are welcome to share your suggestions and messages to the Yahoo Groups mailinglist amongst the other XBasic users and they are also ready to give advises and tips but some own initiatives and exploration is handy when discussing problems.

Subscribe to xbasic

Powered by groups.yahoo.com