Small Basic: Expression

This article explains about expression in Small Basic.  In Mathematics, there are three types of expression - identify, equation and definition.  But in Small Basic, there are two types of expression - substitution and condition.


Substitution

Substitution is equality which heft-hand side is a variable or a property of an object and right-hand side becomes a value. The value is assigned into the variable or the property.  Following three lines are all substitutions.

gw = 598
GraphicsWindow.Width = gw
a = 2 *  Math.Pi * r

In Small Basic, right-hand side of substitution equality is not allowed to use boolean operation (And or Or), equality or inequality.

Condition

Condition is described in If statement or While statement.  Condition is an equality, an inequality, a boolean variable, or an expression with boolean operation(s) which becomes a boolean value ("True" or "False").  In following lines, condition is (0<= x) And (x < gw) And (0 <= y) And (y <= gh).

If (0<= x) And (x < gw)  And (0 <= y) And (y <= gh) Then
  color = GraphicsWindow.GetPixel(x, y)
EndIf

See Also

Other Languages