home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / m2 / CycloneModules.lha / modules / txt / Terminal.def < prev    next >
Text File  |  1995-04-13  |  2KB  |  79 lines

  1. DEFINITION MODULE Terminal;
  2.  
  3. (* (C) Copyright 1993 Marcel Timmermans. All rights reserved. *)
  4.  
  5. FROM SYSTEM IMPORT WORD;
  6.  
  7. PROCEDURE Read( VAR ch :CHAR );
  8. (*
  9.     read a character
  10. *)
  11.  
  12. PROCEDURE ReadString( VAR s :ARRAY OF CHAR );
  13. (*
  14.     read a string.
  15.     input is terminated by a ' ', or any control character except BS or DEL.
  16.     the terminating character is saved in termCH.
  17.     when reading from the terminal, editing of the input is available:
  18.         ASCII.BS deletes the last characted input
  19.         ASCII.DEL deletes all characters input
  20.         ASCII.ESC deletes all characters input and returns
  21. *)
  22.  
  23. PROCEDURE ReadInt( VAR x :INTEGER );
  24. (*
  25.     a string is read from the input device and is then converted to
  26.     an INTEGER.
  27. *)
  28.  
  29. PROCEDURE Write( ch :CHAR );
  30. (*
  31.     write the character
  32. *)
  33.  
  34. PROCEDURE WriteLn;
  35. (*
  36.     same as: Write( ASCII.EOL )
  37. *)
  38.  
  39. PROCEDURE WriteString( s :ARRAY OF CHAR );
  40. (*
  41.     write the string out
  42. *)
  43.  
  44. PROCEDURE WriteLine( s :ARRAY OF CHAR );
  45. (*
  46.     same as: WriteString( s ); WriteLn;
  47. *)
  48.  
  49. PROCEDURE WriteInt( x :LONGINT; n :CARDINAL );
  50. (*
  51.     write the INTEGER right justified in a field of at least n characters.
  52. *)
  53.  
  54. PROCEDURE WriteCard( x : LONGCARD; n : CARDINAL);
  55. (*
  56.     write the CARDINAL right justified in a field of at least n characters.
  57. *)
  58.  
  59. PROCEDURE WriteOct( x, n :CARDINAL );
  60. (*
  61.     write x in octal format in a right justified field of at least n characters.
  62.     IF (n <= 3) AND (x < 100H) THEN 3 digits are written
  63.     ELSE 6 digits are written
  64. *)
  65.  
  66. PROCEDURE WriteHex( x :LONGINT; n :CARDINAL );
  67. (*
  68.     write x in hexadecimal in a right justified field of at least n characters.
  69.     IF (n <= 2) AND (x < 100H) THEN 2 digits are written
  70.     ELSE 4 digits are written
  71. *)
  72.  
  73. PROCEDURE ReadLongInt( VAR x :LONGINT );
  74. (*
  75.     a string is read from the input device and is then converted to
  76.     a LONGINT.
  77. *)
  78.  
  79. END Terminal.