home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / CPREADLN.ZIP / CPREADLN.PAS
Encoding:
Pascal/Delphi Source File  |  1988-05-02  |  689 b   |  43 lines

  1. program ReadLine;
  2.  {A test to simulate the ReadLn procedure}
  3.  
  4. uses
  5.  Crt;
  6.  
  7. var
  8.  IS : string[80];
  9.  
  10. procedure ReadLn ( var InStr );
  11.  
  12. var
  13.  Ch : char;
  14.  InS : string[80] absolute InStr;
  15.  
  16. begin
  17.  Ch := #32;
  18.  InS := '';
  19.  repeat
  20.   if not keypressed
  21.    then {Whatever you need to do to pass the time slice}
  22.    else
  23.     begin
  24.      Ch := readkey;
  25.      if ( Ch = #13 )
  26.       then { do nothing }
  27.       else { This is very simple and you may have to add some editing}
  28.        begin
  29.         write ( Ch );
  30.         InS := InS + Ch;
  31.         Ch := #32;
  32.        end;
  33.     end
  34.  until ( Ch = #13 );
  35.  writeln;
  36. end;
  37.  
  38. begin
  39.  IS := '123';
  40.  readln ( IS );
  41.  writeln ( IS );
  42. end.
  43.