Adding Content to a Source File

VisualAge C++ has a built-in editor that you can use from any page in the workbook.

You can work on the same file simultaneously on one or more pages. You do not need to worry about your file relationships becoming outdated: changes made in source code on one page will immediately be reflected in every other page displaying the same section of code.

You have just finished creating a new project, but you have no content in your source files to edit yet.

To open and edit a source file:

  1. From any tab, pull down the Project Workbook menu, and select Open or Create File.
  2. In the Open File dialog box, the file you specified when you created the project (helloworld.cpp) is selected in the File name field. (If it is not, browse through the Drives and Folders fields to find it, and select it.)
  3. Click Open to open helloworld.cpp. A source view of your empty file is opened.
  4. Click anywhere inside the editor pane, and type or paste this short sample:
#include <iostream.h>
int main()
{
	cout << "Hello World" << endl; 
	return 0;
}

You have just edited a source file. You do not have to explicitly save this file because all project files are saved when you build your project.