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.