Small Basic – When is an Equal Sign (=) a comparison?

When an equal sign (=) appears in a logical expression, it means it’s a comparison, not an assignment. For example, check out the code below:


If (num = 0) Then

  ' The rest of your life-changing code



The first statement doesn’t change the value of the variable num to 0. It just tests the value of num against 0 and lets you know whether the answer’s true or false.


You can learn more about Small Basic over at

Small and Basically yours,

   - Ninja Ed & Majed Marji

Comments (1)

  1. Computers Today (part 1 of 6)…/computers-today.aspx


    CS SPOTLIGHT: Girls in computer programming… why it matters!!!…/cs-spotlight-girls-in-computer-programming-why-it-matters.aspx

    Computational Thinking – Videos & Papers by Jeannette Wing…/computational-thinking-videos-amp-papers-by-jeannette-wing.aspx

Skip to main content