Compound Basic - Beta 0.2.51
Posted: Sun Aug 14, 2005 12:54 am
Over the summer I have been working on creating a new BASIC language in PureBasic, I had a fair bit of success and have decided to open the beta to everyone. This release is the last in the current generation of CB interpreters, I've decided to rewrite the whole thing from scratch (removing a lot of bugs) and develop a PB scripting language parrallel to it.
There is help file included which deals with all of the commands in CB, but there are a few things I did not get round to writing about.
Maths
Math statements must be followed by a ';'. Conditions do not have to be followed by a ';'
Comments
A line must start with a ' to be consider a comment
Declaring Variables
Use either:
"IFs"
Loops
Only 'while' or 'do' loops are considered
Operators
Supported operators:
Debug
Use either:
Note: 'Output' and 'Debug' are exactly the same - I just wasn't sure which keyword I should use, so I included both. Which do you prefer?
Commands
Use commands in exactly the same way as in PureBasic (read a bit further down to see why this is). CB even supports nested commands. You can have maths expressions as arguments but you cannot perform maths operations directly on command calls
Download 0.2.264
If you have any questions, suggestions or comments then either email me at evil_grunger@hotmail.com or post here!
Edit: Extended the explination a little bit.
There is help file included which deals with all of the commands in CB, but there are a few things I did not get round to writing about.
Maths
Math statements must be followed by a ';'. Conditions do not have to be followed by a ';'
Code: Select all
Bob.l=1+2;
A line must start with a ' to be consider a comment
Code: Select all
'This is a comment
Len(String.s) 'This is an error
Use either:
Code: Select all
Bob.l
Bob.s
Bob.f
Code: Select all
DEF Bob, Jim, Tim ~ Using defualt type (Long)
Def.[l,s,f] Bob, Jim, Tim ~ Using specified type
Code: Select all
IF <Condition> THEN <Action>
If Bob=1 THEN Bob=2;
Only 'while' or 'do' loops are considered
Code: Select all
While Bob=1
'Code
Wend
Do
'Loops forever
Loop
Do
'Loops until condition is true
Until Bob=1
Supported operators:
Code: Select all
=
+
-
(
)
*
/
<
>
<>
>=
<=
AND
OR
^
Use either:
Code: Select all
Debug Len("a")
Debug 1+2;
Output Len("a")
Output 1+2;
Commands
Use commands in exactly the same way as in PureBasic (read a bit further down to see why this is). CB even supports nested commands. You can have maths expressions as arguments but you cannot perform maths operations directly on command calls
Code: Select all
Len("1")
Bob.l = Len("1")
Bob.l = Len(Mid(Left("abcd",2),1,1))
Bob.l = Mid(Left("abcd",1+1),1,1)
Bob.l = Mid(Left("abcd",1)+"a",1,1) WRONG
If you have any questions, suggestions or comments then either email me at evil_grunger@hotmail.com or post here!
Edit: Extended the explination a little bit.