Tuesday, March 10, 2009

Basic4GL Programming Language

What is Basic4GL
Basic4GL is a programming language which is a dialect of the basic programming language. Basic4GL is designed so that it is easy to use the OpenGL Windows API, in fact you can start by programming in OpenGL. You can get plug-in .dll files for basic4GL which could make it easier to use basic4GL for certain events like playing movies. Basic4GL was created by a guy named Tom Mulgrew in his own spare time. If you would like basic4GL you can get it at
If you would like to see what the main projects are or maybe get a plug-in and even help with programming in basic4GL, the site link is
There is a list of tutorials, projects, plug-ins and a whole lot of other stuff at the basic4GL wikispace. The link is

What is the use of Basic4GL
The main use of basic4GL is to make graphics based applications like games. It is fairly simple to create 3D games in basic4GL as long as you know basic and OpenGL coding. Basic4GL can be used to prototype your game before porting it to another programming language like C++.

Basic4GL Syntax
As of version 2.3.2, Basic4GL supports a new "traditional BASIC" syntax. This syntax is intended to be more compatible with other BASIC compilers, to make porting code between them and Basic4GL a little bit easier, and to make programming in Basic4GL a little easier for people who are used to other BASIC compilers.
The new syntax must be explicitly enabled, otherwise Basic4GL will simply use the standard Basic4GL syntax.You do this by placing the following command at the top of your program:
language traditional
Basic4GL also accepts:
language basic4gl
Which will switch the compiler to the standard Basic4GL syntax. (Although it's not really necessary, as this is the default syntax anyway.)
And also:
language traditional_print
Which is a tradeoff between the standard Basic4GL syntax, except with a more traditional "print" command syntax.

Tutorials and Demo Programs
I have created a quick set of tutorials for basic4GL and even code of sample programs I created. Ok in the tutorials since they are created by me (The same tutorial might be on the web somewhere else) you may learn more than one new things in basic4GL even if the tutorial wasn’t meant to have
My First Program Tutorial
Welcome to my first program tutorial. This tutorial will teach you how to create a hello word application. Code will look something like this.
The code should look like this.
Ok basic4GL is a very good programming language that can be used to create more than just games, applications and a lot more if you get the skill.
Ok well here is the code to the hello world program
print "Hello World"
Well that is all you need to program a hello world program in basic4GL. Ok lets analyse the hello world code.
Print in basic4GL means the curser is placed right at the end of the last character typed. If you would like to place the cursor on the next line you would need to use a function called printr. Here is a example program that will use both types of print in this application
print "Hello World"
printr "The world is young and new"
printr "So don't waste your life"
Ok now you see how to use print and you have created your first program. Try change the text and use the different print functions for a bit.
Now your ready to go onto the next tutorial.

No comments:

Post a Comment