DEFINITION MODULE LongInOut;

(* Read and write procedures for LONGCARDs, LONGINTs and ADDRESSs 
   from/on InOut.In and InOut.Out based on the InOut.Read... and
   InOut.Write... procedures. *)

FROM   SYSTEM  IMPORT ADDRESS;

VAR Done : BOOLEAN;

PROCEDURE WriteLongInt(TheNumber : LONGINT; 
                    Length    : CARDINAL); (* min. length *)
  (* Writes the LongInt number. *)

PROCEDURE WriteLongCard(TheNumber : LONGCARD; 
                     Length    : CARDINAL); (* min. length *)
  (* Writes the LongCard number in decimal representation. *)

PROCEDURE WriteLongOct(TheNumber : LONGCARD;
                    Length    : CARDINAL); (* min. length *)
  (* Writes the LongCard number in Octal representation. *)

PROCEDURE WriteLongHex(TheNumber : LONGCARD;
                    Length    : CARDINAL); (* min. length *)
  (* Writes the LongCard number in Hexadecimal representation. *)

PROCEDURE WriteAdr   (TheAddress : ADDRESS; 
                      Length     : CARDINAL); (* min. length *)
  (* Writes the Address in decimal representation. *)

PROCEDURE WriteAdrOct(TheAddress : ADDRESS; 
                      Length     : CARDINAL); (* min. length *)
  (* Writes the Address in Octal representation. *)

PROCEDURE WriteAdrHex(TheAddress : ADDRESS; 
                      Length     : CARDINAL); (* min. length *)
  (* Writes the Address in Hexadecimal representation. *)

PROCEDURE ReadLongInt(VAR TheNumber : LONGINT);
  (* A LongInt number is read using InOut.ReadString.
     Syntax as in InOut.ReadInt. 
     Done := "Long Integer was read."*)

PROCEDURE ReadLongCard(VAR TheNumber : LONGCARD);
  (* A LongCard number is read using InOut.ReadString.
     Syntax as in InOut.ReadCard.
     Done := "Long Cardinal was read."*)

PROCEDURE ReadAdr(VAR TheAddress : ADDRESS);
  (* TheAddress is read using InOut.ReadString.
     Syntax as in ReadLongCard.
     Done := "Address was read."*)

END (* DEFINITION MODULE *) LongInOut.
