Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1 Introducing Small Basic

Similar presentations


Presentation on theme: "Chapter 1 Introducing Small Basic"— Presentation transcript:

1 Chapter 1 Introducing Small Basic
To get your own copy of Small Basic for your home computer, go to

2 LESSON (fill in your Note Taking Guide):
A COMPUTER ________________________________ ______________________________________________ The HARDWARE ______________________________ The SOFTWARE ______________________________

3 SYNTAX RULES ______________________________
______________________________________________ _________________________________________: LANGUAGE LIBRARY INTEGRATED DEVELOPMENT ENVIRONMENT (IDE).

4 The Integrated Development Environment (IDE) is where you will write your programs.

5 *By the way, these are the same in other Microsoft products!
The SHORTCUT KEYS for the Small Basic Toolbar: *By the way, these are the same in other Microsoft products!

6 These are some important aspects of the program:
___________________________ in front means that is a non-executable line. Used for titles, comments, and remarks. (Green) The __________________means that it is a Small Basic program. It will save correctly whether you add it or not! As you type, ___________________________suggestions will come up. Cursor to your choice, then press ENTER or double click to choose one. If you need to see the code underneath, just hold down the CTRL key.

7 ____________________: A toolbox for doing a pre-defined task
____________________: A toolbox for doing a pre-defined task. It is a mini-program that does what you need. The actual programming is “behind the scenes”, rather than you having to create all the programming every time! (Blue-Green) ____________________: the tools that will do something with the OBJECT. (Dark Red) When you choose an OBJECT, the possible METHODS come up in the HELP area. To give the Method a value, put it in parentheses. The value is called an ARGUMENT. (Orange)

8 Click on the NEW button and type this in EXACTLY as you see it and then press RUN.

9 We can use the Methods: BackgroundColor and ForeGroundColor, to change our TextWindow Object. Type this in EXACTLY as you see it, then press RUN.

10 White Black Blue DarkBlue Cyan DarkCyan Gray DarkGray Green DarkGreen Magenta DarkMagenta Red DarkRed Yellow DarkYellow Using the list of colors to the right, try several combinations to see what you might like. Don’t forget to put the color in quotes!

11 To Save: Create a NEW FOLDER called Chapter 1 on your flash drive
To Save: Create a NEW FOLDER called Chapter 1 on your flash drive. Using the SAVE button, save under GREETINGS 2. In the future, you will name your programs whatever you like. Just make sure that the name that you choose is meaningful and does not contain symbols. However, your documentation ALWAYS needs to have the name I give you. ***You do not need to add the “sb” at the end, Small Basic does it for you.***

12 You are going to create your SHELL program!
This will be the shell or template that you will use EVERY TIME you write a program to be turned in. The DOCUMENTATION will include the Program name (that is in the assignment.) Your name. Due date. A brief description of what the program will do. The VARIABLES section will include everything that are not Objects, Methods, in quotes, in parentheses, or numbers. They are made up by the program’s author.

13 Use plenty of REM descriptions and space!!!
We will begin each line of non-executable code with an apostrophe (REM or Remarks symbol.) This prompts the computer to “overlook” the sentence. Spacing and decorative symbols are also used to keep it separate. Put these lines in your Shell so that you do not have to type it in every time. You may choose your own colors, but make sure that they are readable. Use plenty of REM descriptions and space!!!

14 SAVE this as SHELL 1 on your flash drive
NOW, SAVE AS SHELL 2 to save it again. This gives you a back up. To practice: CLOSE ALL DOCUMENTS AND THE PROGRAM by clicking on the “x” in the right corners. Let’s OPEN SMALL BASIC, your SHELL 1 and your GREETINGS 2 program, again. Always open the file with the “sb” at the end, as some of your files may have other extensions.

15 To Print The Your Program: You will SELECT all lines, choose COPY and then PASTE the contents of your program onto NotePad or WORD. Pretty easy, right? Notice it is only in black and white, no colors—but that’s OK. To Print the Out-put: In the executed mode (you pressed RUN ), click on the symbol in the upper left corner. Choose Edit and then Select All. Click on the symbol, again, and choose to Copy. Open NotePad and Paste! These instructions are for the TextWindow OBJECT, only:

16 Assignment 1: OPEN your SHELL 1 and GREETINGS 2 programs. COPY your GREETINGS 2 onto the SHELL 1. SAVE AS GREETINGS 3. OPEN a new page in NotePad. COPY the GREETINGS 3 program onto NotePad. RUN the program and add the output to the NotePad document. PRINT and turn in for a grade. Due___________

17 Graphical User Interface (GUI):
We have been using a text-based user interface as all we have done was type sentences. Now, we can use the GraphicWindow object to add buttons, shapes, images, etc. (Even text!) Type this in EXACTLY as you see it and then press RUN. The DrawText method requires 3 ARGUMENTS: The horizontal position (x). The vertical position (y). The text to display.

18 You get: (0,0) 50 100 How do the values, “100” and “50” affect the output? The upper corner of the output screen is the (0,0) position. The first number: “100” represents the horizontal position (x), and the second number: “50” represents the vertical position (y). Unfortunately, while we can copy the programming onto a document (to turn in), the graphics screen does not have the EDIT tools that the text-based window does. We will use screen captures to get the output.

19 Quick review. Using the code below, answer the following questions:
Which part of the code are the arguments? 100, 50, Greetings, Planet! Which part of the code is the object? GraphicsWindow Which part of the code is the method? DrawText( )

20 Type this in EXACTLY as you see it and then press RUN.
These shape methods require FOUR arguments: The horizontal position (x) (upper left corner). The vertical position (y) (upper left corner). The width of the shape. The height of the shape. {We will address changing the colors, later.} 20 20 100 100 100 200

21 To get the GraphicsWindow output to turn in:
Click on the Windows icon on the lower left of your computer screen: Go to: All Programs Accessories Snipping Tool The Snipping Tool will appear: The screen will go “gray” and you will “Drag the cursor around the area you want to capture.” This will be on the clipboard, use the PASTE tool to place the image below your program document to turn in. KEEP the Snipping Tool (don’t close it.) Next time you need it, the old copy will appear, just choose NEW. Try copying your output from the previous slide.

22 Chapter 1 Programming Assignment
Using your SHELL 1, SAVE AS MESSAGEBOX or whatever you want. Just remember: in the Documentation, you must refer to it as MESSAGEBOX. Write a program to display your name and title in a MESSAGEBOX using the GraphicsWindow OBJECT. Instead of using the DrawText METHOD, you will use the ShowMessage METHOD. The ShowMessage( ) METHOD requires two arguments, the message inside of the box and the title of the box. Put these in quotes, with a comma between. Notice, to the right, there is HELP information. PASTE copies of the programming and output onto a document and turn in. Due__________

23 Vocabulary Test on___________ and a small program to write
Vocabulary Test on___________ and a small program to write. You will have a Review sheet for the test.


Download ppt "Chapter 1 Introducing Small Basic"

Similar presentations


Ads by Google