home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / PASTUT34 / USERIO.PAS < prev    next >
Pascal/Delphi Source File  |  1993-01-14  |  1KB  |  32 lines

  1. program InputOutput;
  2.  
  3. {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
  4. { Program to illustrate user input from the keyboard and output to the  }
  5. { screen. Use is made of the procedures Readln, Write and Writeln found }
  6. { in the System Unit, which does not have to be declared in the Uses    }
  7. { clause as it is automatically made available. Consult the Library     }
  8. { Reference for details of these procedures.                            }
  9. {                                                                       }
  10. { USERIO.PAS  ->  USERIO.EXE       R Shaw             13.1.93           }
  11. {_______________________________________________________________________}
  12.  
  13. uses Crt;          {The Crt unit contains the procedure to clear the screen}
  14.  
  15. var
  16.    ch  : array[1..3] of char;
  17.    i   : integer;
  18.  
  19. begin
  20.    ClrScr;
  21.    for i := 1 to 3 do
  22.    begin
  23.       write('Please enter leter ',i,' of a three letter word and press ENTER: ');
  24.       readln(ch[i]);
  25.    end;
  26.    writeln;
  27.    writeln('The word is: ',ch[1],ch[2],ch[3]);
  28.    writeln;
  29.    write('Press any key to conclude.');
  30.    repeat until keypressed;
  31. end.
  32.