Setting Up TextPad for Visual C++

Getting TextPad

TextPad is a commercial text editor whose current version is 5.3.

TextPad is available at http://www.textpad.com/download/. You can download a copy to try out. If you like TextPad as an editor you might consider buying it (about $30 currently).

Before setting up TextPad for using Visual C++ you need to have already installed Visual C++ and to have an appropriate batch file such as cpp.bat or c++v9.bat. The set up in the labs, which have Visual Studio 2008 installed, uses cpp.bat (to download follow the link, right click on the file name in the directory and select "Save link as..."). If you install Visual Studio 2008 in a non-fault location you will have to make appropriate changes in the batch file.

If you have Visual Studio 2008 you already have C++ (version 9). Some CD's for installing Visual Studio 2008 Express Edition will be available for you to borrow. Ask Dr. Naugler or your instructor. Visual Studio has a sophisticated environment which you should not use until so directed by your instructor. TextPad is a much simpler editor which very easy to learn to use and quite capable.

Settings for Compiling and Running Visual C++

  1. When TextPad is started a screen will appear. See image

  2. To set up TextPad to compile and run Visual C++ programmes, first select the Configure menu option and then from the screen that appears select Preferences. See image

  3. A new window will appear which is similar to the See image image. - if it is different --> Be sure that Tools is selected on the left but has not been opened (i.e. there is a + sign in front of it, not a - sign).

  4. Select Add.

  5. From the menu that drops down select Program. A window will appear. Navigate in the Look In box at the top to the location of your batch file (c++v9.bat in image) and select it. See image

  6. You can use the default name or, if you wish, select your batch file in the middle window and overtype the name with, for example, Compile C++. Press Apply.

  7. You should still be in the Preferences window; if not return to it. On the left click on the + sign in front on Tools (or double click Tools). An indented list ot tools will appear and the + will change to -.

  8. Select c++v9 or whatever you called it. A new window will appear. See image. You need make no changes.
  9. Make sure that Tools has the + sign before it again. As above, select Add then select Dos Command and enter cmd.exe, See image. If you wish you can select cmd.exe and overtype it with a more reasonable name such as Run C++. Press Apply. Open Tools; a - sign and a list of tools will appear. Select cmd.exe or whatever you renamed it and in the Parameters: box enter $BaseName, and in the Initial folder: box enter $FileDir. see image. If you want to be be able to enter input make sure the Capture output is NOT checked. Note that if Capture output is not checked the output will appear in a command box and will disappear when the command box is closed. If Capture output is checked the output will appear in a TextPad window and can be easily saved, printed, or cut and pasted to another file. When done press Apply. Leave the Preferences by pressing OK. see image. You might consider having the tool RunC++ capture output and create another tool, say RunC++wInput, which does not capture output but allows input. Otherwise you will probably find yourself going to Preferences to check and uncheck Capture output.

  10. If you select the Tools menu of TextPad, you should see the two tools you entered under External Tools with with control keys on the right. Using the control keys is very convenient. The next step is to test your work by compiling and running a C++ programme.

If there are errors or problems, contact:

David Naugler
dnaugler@semo.edu

Valid XHTML 1.0!