Hands-On Instructions For Turbo C
April 19, 2004 -  INSTRUCTIONS FOR TURBO C

HANDS-ON INSTRUCTIONS FOR Turbo C


Read through the following sections. Do the examples at the end of each section Look back at a previous sections for help. Read the screen. Any time it says press any key, press a key (like the spacebar) after reading the screen.

A. Entering your program
   The enter key is represented by <-.  Type the following example.
   /* Sample Program */                                  <-
   #include                                     <-
   #include                                     <-
   main()                                                <-
   {                                                     <-
         int sum;                                        <-
         printf("START\n");                              <-
         sum = 3 + 7;                                    <-
         printf("THE SUM IS %d\n",sum);                  <-
         printf("DONE\n");                               <-
         return 0;                                       <-
   }                                                     <-
   If you make a mistake backspace to erase it, and retype the characters

B. Saving program
   To save a file,
      press Alt F (for file menu)
      type S (to save)

If the file has not been saved before, type the filename and press enter. If the file has been save before then it will be saved under the old name.

Save the program you have just written in part A as SAMPLE Notice there are no spaces in the filename. Note: To save under new name use the Save As option.

FILENAMES can consist of a drive letter (A: for left/top/only drive) followed by a colon then the filename (consisting of a name 8 characters or less beginning with a letter) and an extension (.CPP) Note: If you want to change the name of the file later, use option A (Save As) on the file menu. This allows you to save the file with a new name.

C. Executing the program
   Executing your program takes 2 steps compiling and running the program.
   Step 1: To compile your program,
      press Alt C (to get the compile menu)
      type C (to compile program)
   Note: A shorter way to execute a program is Alt and F9
   Step 2: To run your program,
      press Alt R (to get to the run menu)
      type R (to run the compiled program)
   Note: A shorter way to execute a program is Ctrl and F9
    If  you  need to stop execution of a program, press the Crtl and  Break
keys.

   To look at the output again
      press Alt W (for Window menu)
      type U (for user screen)
    Another  way  to see the output is Alt F5.  Once in the  output  screen
   press any key to get back to the editor.
   Note: To print the output screen, press the Print Screen key.
D. Making corrections to your program
   1. typing over characters
       To type over character, first get out of the insert mode by pressing
INSERT  key,  then  position cursor and type over  characters.  Notice  the
cursor is now a blinking block.
         change all 3's to 8's and change all 7's to 9's in line
            sum = 3 + 7;
         to be
            sum = 8 + 9;

  2. inserting characters
      To  insert  characters, first get into insert mode (by  pressing  the
INSERT  key)  and  positioning  cursor and then  type  the  characters  in.
You will notice the cursor is now a blinking line.
      Note:  Do  not position using the enter key, else you  will  get  new
lines.
        insert the phrase 'WE ARE ' in line
           printf("DONE\n");
        to be
           printf("WE ARE DONE\n");

  3. deleting characters
      To delete characters, position cursor to characters to be deleted and
press the DELETE key.
        delete the characters 'THE' in line
           printf("THE SUM IS %d\n",sum);
        to be
           printf("SUM IS %d\n", sum);

  4. inserting lines
      To insert lines, position cursor to where you want the new line to go
before  and  at  the  beginning  of that  line  press  enter;  or  position
cursor  to  the  end of line you want it to go after and  press  the  enter
key.
       insert the following line before the first printf.
          clrscr();

  5. deleting lines
     To delete lines,position cursor to line to be delete and press CTRL Y
         delete the following line
           printf("START\n");

Note: Please save these changes before going to the next section.

E. Listing the program to the printer
   Note: Before you try to print make sure you do the following:
   1. turn printer on
   2. switch the printer switch box to your computer
   3. printer online light is on.  If it is not press the online button.

   To print your hardcopy on the printer,
     press ALT F (for file menu)
     type P (for print)

   To get the paper out of the printer do the following:
    1.  press  the  formfeed  button (once  or  twice)  till  you  see  the
perforation.
   2. tear the paper at the perforation.
F. Close Window
   To close current window,
      type Alt W (for window menu)
      press C (to close current window)
   Note: The Close All option is used to close all open windows.  This does
not exit Turbo C.

G. Clear Workspace for new program
   To clear the workspace for a new program,
      type Alt F (for file menu)
      press N (for new)

   Before it clears the workspace, you will be prompted to save the file if
it  has  not been saved with the new changes.  [Use the tab key to move  to
correct response then press enter.]

H. Load/Open old program
   To load a previously created program,
      type Alt F (for file menu)
      type O (to open a program)
      It will ask you for a filename.  Type SAMPLE and press enter.

I. Use DOS Commands
   To clear user screen with DOS command,
          press Alt F (for file menu)
          type D for (DOS prompt)
          at A> prompt
             type  CLS <- (or any DOS command)
          to return to Turbo C type EXIT <-
   Note: You can delete files by typing ERASE filename.ext at a> prompt.

J. Exiting Turbo C
   To exit Turbo C,
          type Alt F (for file menu)
          press Q (to quit Turbo C)

If the file hasn't been saved, it will prompt you to save the file before exiting Turbo C.



 
Suggestions or comments send email to Judy Gasque
E-Mail: mailto:JGasque@FMarion.Edu?SUBJECT=http://alpha1.fmarion.edu/~acadcompserv/staffhelp/