Home > Articles > Programming

  • Print
  • + Share This
This chapter is from the book

Printing a Program

If you have a printer connected to your system, you can print a hard copy of your program. Although you don't have to print your programs, you might want to have a copy on paper to file away. Also, it's often easier to find programming errors on paper than onscreen. More importantly, printing programs uses up ink and paper, which makes it look like you're actually accomplishing something. (Of course, wasting paper also kills trees, so you might want to examine your priorities—or recycle the printouts of your unfinished novel by printing on the reverse side.)

How about printing the program you just wrote? To print, select the Print item of the File menu. You'll see the dialog box shown in Figure 3.9.

Figure 3.9Figure 3.9 The Print dialog box.

The Print dialog box contains several printing options. You can print selected text only (you'll learn to select text later in this chapter), text shown in the current window only, or the entire program.

When the Print dialog box first appears, it assumes you want to print the entire program, so that option is already selected for you. (Nothing like a mind-reading computer, eh?) However, you can change the option easily. From your keyboard, use the up and down-arrows to move the selection marker (the dot) to the option you want and then press Enter. To use your mouse, click the option you want and then click the OK button.

Onscreen buttons are used in many computer programs to enable you to make selections in dialog boxes. Buttons in computer programs work much like buttons in real life, the difference being that you push onscreen buttons by clicking your mouse, and you push real buttons with your finger. (Some computers let you push onscreen buttons with your finger, too. In the future, most computers will work this way.) In QBasic, buttons are usually at the bottom of a dialog box and are a pair of angle brackets containing commands like OK or Cancel. They don't look as cool as the buttons you see in Windows. (QBasic is old, remember?)

For now, select the Entire Program option and press Enter. The Print dialog box vanishes from the screen, and your program prints on your printer. You now can annoy people further with your bragging—they'll especially enjoy you waving the newly printed program in their faces while saying "na na nana na."

Cool Stuff

QBasic includes an online help system. If you aren't sure how to do something, check the Help menu. This menu provides access not only to help for QBasic but also to full instructions for using the help system. To see these instructions, select the Using Help command of the Help menu or press Shift+F1. Many dialog boxes contain a Help button that lets you get instant help about the dialog box.

  • + Share This
  • 🔖 Save To Your Account