In another thread, http://www.ionicwind.com/forums/index.php?topic=5598.msg41896#msg41896 (http://www.ionicwind.com/forums/index.php?topic=5598.msg41896#msg41896)
the discussion raised the question of why CBasic might be a good choice for program development.
So I guess as a long time fan of Creative, I should add my view of this little jewel of a language. :)
Simplicity .. ;D
There is only one file type needed - .cba for source code. Although at a suitable time, you can create an .exe file for distribution. There are no .obj, .asm, .opts files.
If you want a Window, you use a Window command - not OpenWindow.
window w,0,0,800,600,wstyle,0,"Creative Basic",messages
Notice there is no obscure & required in front of the message handler routine name.
To set up a Button Control, the syntax in CBasic is:
The argument list is a String - and can be processed using any string functions - such as when you want to place the command in a loop generating lots of similar controls using just one statement.
There are no superfluous ENDSUB statements in CBasic subroutines. The termination is just a RETURN statement, not requiring an obscure '0' argument (unless you actually are returning a value).
If a subroutine has no argument list, it is simply written as for example:
In CBasic, there are no erudite 'compund' operators. If you want to increment a variable by say 3, you write:
i = i + 3, not as
i += 3
Incrementing by one is simple Basic
i = i + 1, not the obscure
If you need to use a Maths function in CBasic such as SIN, just use it with a radian argument.
You do not need to worry whether you should be using FSIN for floating point, FSIND for double precision, SIN, or SIND.
CBasic's clever feature is that all arithmetic is carried out behind the scenes using double precision , and converted to the receiving value's data type when done. Simple is always best. ;)
Then consider finding logic problems as you develop a program. CBasic has a great debug facility.
Paste this little test program into the CBasic editor window:
pi = 4 * atan(1)
2pi = 2 * pi
y = 2pi / 4
If you run it, it will stop at the STOP statement.
Now click on the Build - Show Variables menu item. This will bring up the Variable List window, showing all the variables and their current contents. You will see that the variable 'y' is still set at 0.
That's because the program hasn't got there yet.
With the focus in the code window, press F5 - this advances one line in the program, and then you see immediately as 'y' is set.
If arrays are involved, all elements of an array can be inspected.
This debug facility is most useful when fathoming out where a program may be going wrong.
The CBasic user guide is always there to explain how all the features are used.
So is it always better to use CBasic rather than EBasic ? Of course not.
EBasic and IWBasic have had years of further development and extra features added. If you need to use those features, then the choice is obvious.
But for ease of use and simplicity, CBasic is my usual choice. :)
Best wishes, :)
I can see why you like CB, and thanks a the detailed explanation.
Think you can come across a programming language and it sits well with you and that's the one you prefer.
I knew you could explain this much better than me... ;D ;D
my explanation is far simplier
i like CB ;D