Share via


Small Basic: Capitalization Conventions

This article is about casing in Microsoft Small Basic programming language and a guide.

Casing in Small Basic

Small Basic itself is case-insensitive.  So, for example, variable name number and Number are the same.

Following language characters have upper and lower case.

  • Latin (ex. A, a)
  • Greek (ex. Β, β)
  • Cyrillic (ex. Д, д)
  • Armenian (ex. Ե, ե)

Following names are case-insensitive.

  • variable
  • label
  • subroutine

Following text literals are case-insensitive.  And other texts are case-sensitive.

  • array index
  • color name
  • dictionary word
  • file path (excluding URL)
  • flickr tag
  • logical value

So for example, the texts are case-insensitive in following cases.

  • color names - ex. "LightGray" and "lightgray" are the same
  • array indices - ex. month["October"] and month["OCTOBER"] are the same

And in condition with = (equal) operation, text is case-sensitive.  So, for example, the condition ("number" = "Number") becomes "False".  If you'd like to allow both uppercase and lowercase for input, you will better to use Text.ConverToLowerCase() or Text.ConvertToUpperCase() operations before checking it.  

Casing Guideline for Names in Small Basic

There is no generally accepted guideline for casing in Small Basic so far.  For readability of source programs, we should be careful about casing.  Since Small Basic is one of .NET languages we can adopt general  .NET  naming conventions.

In a TechNet article "Small Basic: Programming Tips" has a description about casing for Variable names.  It says:

There are conventions for variable naming, but most common is to mainly use lower case and capitalize each word apart from the first (that remains lower case).

Following list is a recommended guideline for casing in Small Basic.

Name for Casing Example
variable Camel prevX
label Pascal RunLoop:
subroutine Pascal OnMouseDown()

Camel casing is starting with lowercase, and Pascal casing is starting with uppercase.  Example names above are from "Introducing Small Basic (Get Starting Guide)".


See Also

Other Resources

Other Languages