home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
549b.lha
/
M2P_v1.0_sources
/
source.lzh
/
FIO.def
< prev
next >
Wrap
Text File
|
1991-08-10
|
3KB
|
76 lines
(*======================================================================*)
(* Amiga Modula-2 support routines *)
(*======================================================================*)
(* Version: 1.20 Authors: Dennis Brueni *)
(* Date : 1-13-91 Changes: Added SetPrompt function *)
(* Date : 1-18-91 Changes: Added BackChar function *)
(* Date : 7-10-91 Changes: Stripped down to basic stuff *)
(*======================================================================*)
(* References: "Programming in Modula-2" by Niklaus Wirth. *)
(* "Portable Modula-2 Programming" by M. Woodman, *)
(* R. Griffiths, J. Souter, and M. Davies *)
(*======================================================================*)
(* FileIO reads and writes Strings and characters. I/O is buffered *)
(* using a 4 Kilobyte buffer. As many files may be opened as memory *)
(* permits. *)
(*======================================================================*)
DEFINITION MODULE FIO;
(*-----------------------------------------------------------------*
* The FILE structure (opaque) *
*-----------------------------------------------------------------*)
TYPE FILE;
VAR INPUT,OUTPUT: FILE; (* For consultation only!!! *)
VAR Window: ARRAY [0..63] OF CHAR; (* Window if started from WB *)
(*-----------------------------------------------------------------*
* File Management Procedures *
*-----------------------------------------------------------------*)
PROCEDURE Open(FileName: ARRAY OF CHAR):FILE;
PROCEDURE Append(FileName: ARRAY OF CHAR):FILE;
PROCEDURE Create(FileName: ARRAY OF CHAR):FILE;
PROCEDURE Close(VAR F :FILE);
(*-----------------------------------------------------------------*
* Returns the whether a FILE is active. *
*-----------------------------------------------------------------*)
PROCEDURE GoodFILE(F: FILE):BOOLEAN;
(*-----------------------------------------------------------------*
* Set the default prompt string for standard INPUT channel *
*-----------------------------------------------------------------*)
PROCEDURE SetPrompt(F: FILE; prompt: ARRAY OF CHAR);
(*-----------------------------------------------------------------*
* Input Procedures *
*-----------------------------------------------------------------*)
PROCEDURE ReadChar(F: FILE):CHAR;
PROCEDURE ReadString(F: FILE; VAR str:ARRAY OF CHAR);
PROCEDURE ReadLn(F: FILE);
PROCEDURE NextChar(F: FILE):CHAR;
(*-----------------------------------------------------------------*
* Output Procedures *
*-----------------------------------------------------------------*)
PROCEDURE WriteChar(F: FILE; ch: CHAR);
PROCEDURE WriteLn(F: FILE);
PROCEDURE WriteString(F: FILE; str: ARRAY OF CHAR);
PROCEDURE WriteCard(F: FILE; num: CARDINAL);
(*-----------------------------------------------------------------*
* Termination Procedure *
*-----------------------------------------------------------------*)
PROCEDURE CloseAllFiles;
END FIO.