Creating a file

Now start the editor again as in the previous section, but this time enter the file name `HELLO.C' instead of `TEST' when the file selector appears. In this section we will create our first program and learn how to edit it.

As you begin, your cursor should be in the upper left hand corner of the screen. Now type in the following famous little `Hello World' program(using the C programming language):

#include <stdio.h>

main()
{
       printf("Hello World\n");
}
When you reach the end of a line, simply press <Return> to create a new one. If you make a mistake, you can use the backspace key to correct it.

While you are typing, note that as you add new lines, the number on the left end of the command line increases accordingly. This indicates the line number of the line being edited.

But notice also that when you are at the end of the file and you hit <Return>, the line number does not increase. Only after you add a character to the new line is the line number incremented. In this way no unnecessary lines are added to the program. A line doesn't exist until it contains characters! Lines that can be `seen' on the screen but contain no characters are called virtual lines.

\fbox{\parbox{14cm}{Lines may be up to 255 characters long. The total length of ...
... that in most
circumstances rather large files can be edited without problem.}} You may also have noticed that the message `New File' disappeared as soon as the line number changed to 2. Whenever a message is displayed in the message bar, as a general rule it will remain until the cursor changes lines or until the space where the message is displayed is required for another purpose.