19.04.2017 Views

Learn to Program with Small Basic

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Throughout this book we’ll include parentheses <strong>with</strong> the names of the<br />

methods, like WriteLine(), so you can easily tell that they’re methods.<br />

Naming Your <strong>Program</strong>s<br />

Project names can make it easy for you <strong>to</strong> identify what your project is<br />

about; these names don’t really matter much <strong>to</strong> <strong>Small</strong> <strong>Basic</strong>. Although we<br />

asked you <strong>to</strong> save this program as Greetings.sb because it was what the program<br />

was about, you could save it as SecretGarden.sb, FuzzyKittens.sb, or even<br />

HungerBoardGames.sb, if you really wanted <strong>to</strong>. Just don’t change the .sb part<br />

of the filename, which is called the extension. <strong>Small</strong> <strong>Basic</strong> programs use that<br />

extension by default, and there’s no reason <strong>to</strong> change it!<br />

Files Generated by <strong>Small</strong> <strong>Basic</strong><br />

When you click the Run but<strong>to</strong>n, <strong>Small</strong> <strong>Basic</strong> creates other files in order <strong>to</strong><br />

run your program. Open the folder where you saved your Greetings.sb program.<br />

Table 1-1 lists the files you should find in that folder if you clicked<br />

Run earlier.<br />

Table 1-1: Files Generated by the <strong>Small</strong> <strong>Basic</strong> Compiler<br />

File<br />

Description<br />

Greetings.sb This is your source code file, which contains everything you<br />

entered in<strong>to</strong> the IDE. If you want <strong>to</strong> edit your code and make<br />

it better, you edit this file.<br />

Greetings.exe This is the executable file created by <strong>Small</strong> <strong>Basic</strong>. This file is<br />

what your computer actually runs. Double-click this file, and<br />

your program will run.<br />

<strong>Small</strong><strong>Basic</strong>Library.dll You can ignore this file for now. The dynamic link library (.dll )<br />

file contains executable code that supplements your Greetings​<br />

.exe file. The Greetings.exe file won’t run <strong>with</strong>out this file!<br />

Greetings.pdb You can ignore this file for now, <strong>to</strong>o. This program database<br />

(.pdb) file contains information that is used by advanced <strong>to</strong>ols<br />

<strong>to</strong> debug, or fix any errors, in the program.<br />

Now that you’ve compiled your source code, you can also run your<br />

Greetings.sb program <strong>with</strong>out using the IDE. You do this by double-clicking<br />

the Greetings.exe file.<br />

NOTE<br />

When you click Run after editing your source file, <strong>Small</strong> <strong>Basic</strong> overwrites the .exe,<br />

.dll, and .pdb files. If you want <strong>to</strong> keep these files, you need <strong>to</strong> manually copy them<br />

<strong>to</strong> a different location before you click Run. Also, don’t forget <strong>to</strong> click Save <strong>to</strong> save the<br />

changes <strong>to</strong> your .sb file.<br />

8 Chapter 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!