{* ** Reads characters from standard input and echoes them ** to standard output until end-of-file is reached. Uses ** only ami.lib functions and so does NOT require dos.bmap. ** ** Must be run from a shell/CLI. ** ** D Benn, July 1995 *} CONST end_of_file = -1& CONST NULL = 0& DECLARE FUNCTION LONGINT fgetc(ADDRESS fh) EXTERNAL DECLARE FUNCTION fputc(LONGINT ch, ADDRESS fh) EXTERNAL ADDRESS in, out LONGINT ch EXTERNAL ADDRESS stdin EXTERNAL ADDRESS stdout in = stdin out = stdout IF in = NULL OR out = NULL THEN STOP REPEAT ch = fgetc(in) IF ch <> end_of_file THEN CALL fputc(ch,out) UNTIL ch = end_of_file