Skip to content
ASCII World

ASCII in Small Basic

Microsoft Small Basic is a simplified programming language designed for beginners learning to code. It provides built-in functions for working with ASCII character codes, making it straightforward to convert between characters and their numeric representations.

The Text object in Small Basic includes two key methods for ASCII operations. Text.GetCharacter(code) takes a decimal ASCII value and returns the corresponding character. Text.GetCharacterCode(character) does the reverse, accepting a single character and returning its ASCII decimal value.

These functions work with the full range of ASCII values from 0 to 127 for standard ASCII, and 0 to 255 for extended ASCII. They are commonly used in Small Basic programs for text manipulation, simple encryption exercises like Caesar ciphers, and generating character patterns.

Small Basic's TextWindow object makes it easy to display ASCII characters and experiment with different codes. The examples below show how to use these functions in practice.

Code Examples

TextWindow.WriteLine(Text.GetCharacter(65))
Converts ASCII code 65 to the letter AOutput: A
TextWindow.WriteLine(Text.GetCharacter(48))
Converts ASCII code 48 to the digit 0Output: 0
TextWindow.WriteLine(Text.GetCharacterCode("A"))
Returns the ASCII code for the letter AOutput: 65
TextWindow.WriteLine(Text.GetCharacterCode("z"))
Returns the ASCII code for lowercase zOutput: 122

Common ASCII Ranges in Small Basic

RangeCharactersSmall Basic Example
48-57Digits 0-9Text.GetCharacter(48) = "0"
65-90Uppercase A-ZText.GetCharacter(65) = "A"
97-122Lowercase a-zText.GetCharacter(97) = "a"
32SpaceText.GetCharacter(32) = " "

Quick Reference

View the complete ASCII table for all 256 character codes, or explore individual character pages for detailed information about each ASCII value.