Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Small Basic language itself is case-insensitive. So, for example, variable name number and Number are the same.
There is not a clear guidelines about casing in Small Basic so far. But, for readability of source programs, we should be careful about casing. And, Small Basic is one of .NET languages. So, I recommend to use .NET guidelines about 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 capitalise each word apart from the first (that remains lower case).
In Small Basic, we can name for variables, labels, and subroutines. Following list is my recommendation.
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)".
In addition, I'd like to talk about text in Small Basic. 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. But following cases, the texts are case-insensitive.
See Also
.NET Framework 3.5 | Design Guidelines for Developing Class Libraries | Capitalization Conventions
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in