730 likes | 1.45k Views
Microsoft ® Small Basic. Introduction to Small Basic. Lesson 1. Introduction to Small Basic. In this lesson, you will learn to:. Explore the Small Basic Environment. Write a Small Basic Program. Understand Key Commands and Statements. Use IntelliSense ® Technology.
E N D
Microsoft® Small Basic Introduction to Small Basic Lesson 1
Introduction to Small Basic In this lesson, you will learn to: Explore the Small Basic Environment Write a Small Basic Program Understand Key Commands and Statements Use IntelliSense® Technology Begin using Variables Use the Properties and Operations of the TextWindow
Part One What is Small Basic? Lesson 1
What is Small Basic? - Exploring the Small Basic Environment A program is a set of instructions that a computer can understand. To write that set of instructions, you use a Programming Language. Small Basic is a Programming Language
What is Small Basic? - Exploring the Small Basic Environment In the beginning, only a few programming languages existed, and they were easy to learn. However, these languages became more and more complex, such as the C# Development tool, and the Visual Basic development environment. This complexity discouraged people who wanted to learn to program applications.
What is Small Basic? - Exploring the Small Basic Environment Small Basic provides you with a simple, but powerful development environment with features like instant context-sensitive help. 2 1: You write your programs in the Programs Editor. 2: You can run various commands by clicking buttons on the Toolbar 1 3 3: You can find information about commands in the Help Window
What is Small Basic? - Writing a Small Basic Program Let’s get started by writing a program. Type: TextWindow.WriteLine(“Hello World!”) into the Program Editor Run your Program by clicking ‘Run’, or press F5 on your keyboard.
What is Small Basic? - Using IntelliSense® Technology Whilst you were writing, did you notice that a list of items appeared with explanations? This is IntelliSense. IntelliSense shows you the commands that you can type. You can scroll through this list using your keyboard, and use ENTER to insert it.
Part Two Statements and Variables Lesson 1
Statements and Variables - Using Statements When you give an instruction to the computer, you create a statement. You can write a program by creating just one statement or by creating two or more statements in a particular sequence. When you wrote: TextWindow.WriteLine(“Hello World!”) You were giving the computer a statement.
Statements and Variables - Showing and Hiding the TextWindow The TextWindow is an object, and you can instruct the computer to perform operations on that object. Try this out by typing the following into the Program Editor: TextWindow.Show() And then run the program. You can see the window.
Statements and Variables - Showing and Hiding the TextWindow Now, switch the ‘.Show()’ for a ‘.Hide()’ TextWindow.Hide() And then run the program.
Statements and Variables - Properties of the TextWindow The TextWindow object has a specific set of properties, such as ForegroundColor, BackgroundColor, Title, CursorTop, CursorLeft, Top, and Left. You can use these properties to change how and where the TextWindow object appears.
Statements and Variables - Using Statements Now you have learned about statements, let’s put that knowledge to good use. Write a program that once run, looks like the image below: TextWindow.ForegroundColor="Blue" TextWindow.WriteLine("Hi everyone!") TextWindow.Title="Hi!"
Statements and Variables - Using Variables We’re now going to learn how to make a variable. Type the following into the Program Editor, and then run the program: TextWindow.Write("Enter your name: ") name=TextWindow.Read() TextWindow.WriteLine("Hello "+name+".") ‘name’ is a Variable. The read command takes the text, and saves it as a variable. The variable is then called by entering the variable name.
Summary The lesson conclusion Lesson 1
Introduction to Small Basic This lesson, you have: Explored the Small Basic Environment Written a Small Basic Program Understood Key Commands and Statements Used IntelliSense® Technology Begun using Variables Used the Properties and Operations of the TextWindow
Microsoft® Small Basic Introduction to Small Basic Lesson 1