home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / m2 / CycloneModules.lha / modules / txt / InOut.def < prev    next >
Text File  |  1996-12-01  |  2KB  |  102 lines

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