Small Basic – Invalid Variable Names


This Table shows some illegal variable names, along with the reason why each name’s invalid.

Table: Invalid Variable Names

Variable Name

What’s Wrong?

2Player

starts with a digit

My.Address

has an invalid character (dot) in the name

Okay?

has an invalid character (?) in the name

room-temp

has an invalid character (minus sign) in the name

room*temp

has an invalid character (*) in the name

room temp

has an invalid character (space) in the name

 

If you use an illegal variable name, the Small Basic compiler detects it and reports a syntax error. And then the programming police show up to arrest you! (That last part might just be a rumor.)

 

Head to http://blogs.msdn.com/SmallBasic to download Small Basic and learn more about it!

Have a Small and Basic day!

   – Ninja Ed & Majed Marji

Comments (2)

  1. Computers Today (part 1 of 6)

    blogs.msdn.com/…/computers-today.aspx

    …..

    CS SPOTLIGHT: Girls in computer programming… why it matters!!!

    blogs.msdn.com/…/cs-spotlight-girls-in-computer-programming-why-it-matters.aspx

    Computational Thinking – Videos & Papers by Jeannette Wing

    blogs.msdn.com/…/computational-thinking-videos-amp-papers-by-jeannette-wing.aspx

Skip to main content