-- Copyright (C) 1983 by Xerox Corporation. All rights reserved.
-- File: PutNoDisk.mesa, HGM, 25-Sep-83 2:34:36
-- From PutsA.mesa of 11-Feb-83 15:11:57
DIRECTORY
Ascii USING [CR],
Environment USING [Block],
Format USING [
Blank, Block, Char, Date, DateFormat, DecimalFormat, HostNumber,
LongNumber, LongOctal, NetFormat, NetworkAddress, NetworkNumber, Number,
NumberFormat, Octal, SocketNumber, StringProc, SubString],
Put USING [],
String USING [SubString],
System USING [HostNumber, NetworkAddress, NetworkNumber, SocketNumber],
Time USING [Packed],
Window USING [Handle],
OthelloDefs USING [WriteString];
PutNoDisk: PROGRAM IMPORTS Format, OthelloDefs EXPORTS Put =
BEGIN
-- Public procedures
Blank, Blanks: PUBLIC PROCEDURE [h: Window.Handle, n: CARDINAL ← 1] =
BEGIN
Format.Blank[OutputString, n, h];
END;
Block: PUBLIC PROCEDURE [h: Window.Handle, block: Environment.Block] =
BEGIN
Format.Block[OutputString, block, h];
END;
Char: PUBLIC PROCEDURE [h: Window.Handle, char: CHARACTER] =
BEGIN
Format.Char[OutputString, char, h];
END;
CR: PUBLIC PROCEDURE [h: Window.Handle] = {
Format.Char[OutputString, Ascii.CR, h]};
Date: PUBLIC PROCEDURE [
h: Window.Handle, pt: Time.Packed, format: Format.DateFormat ← noSeconds] =
BEGIN
Format.Date[OutputString, pt, format, ANSI, h];
END;
Decimal: PUBLIC PROCEDURE [h: Window.Handle, n: INTEGER] =
BEGIN Number[h, n, Format.DecimalFormat]; END;
Line: PUBLIC PROCEDURE [h: Window.Handle, s: LONG STRING] =
BEGIN Text[h, s]; CR[h]; END;
LongDecimal: PUBLIC PROCEDURE [h: Window.Handle, n: LONG INTEGER] =
BEGIN LongNumber[h, n, Format.DecimalFormat]; END;
LongNumber: PUBLIC PROCEDURE [
h: Window.Handle, n: LONG UNSPECIFIED, format: Format.NumberFormat] =
BEGIN
Format.LongNumber[OutputString, n, format, h];
END;
LongOctal: PUBLIC PROCEDURE [h: Window.Handle, n: LONG UNSPECIFIED] =
BEGIN
Format.LongOctal[OutputString, n, h];
END;
LongString, Text: PUBLIC PROC [h: Window.Handle, s: LONG STRING] = {
OutputString[s, h]};
Number: PUBLIC PROCEDURE [
h: Window.Handle, n: UNSPECIFIED, format: Format.NumberFormat] =
BEGIN
Format.Number[OutputString, n, format, h];
END;
Octal: PUBLIC PROCEDURE [h: Window.Handle, n: UNSPECIFIED] =
BEGIN
Format.Octal[OutputString, n, h];
END;
LongSubString, SubString: PUBLIC PROCEDURE [
h: Window.Handle, ss: String.SubString] =
BEGIN
Format.SubString[OutputString, ss, h];
END;
-- Network related procedures
NetFormat: TYPE = Format.NetFormat;
HostNumber: PUBLIC PROCEDURE [
h: Window.Handle ← NIL, host: System.HostNumber, format: NetFormat] =
BEGIN
Format.HostNumber[OutputString, host, format, h];
END;
NetworkAddress: PUBLIC PROCEDURE [
h: Window.Handle ← NIL, address: System.NetworkAddress, format: NetFormat ← octal] =
BEGIN
Format.NetworkAddress[OutputString, address, format, h];
END;
NetworkNumber: PUBLIC PROCEDURE [
h: Window.Handle, networkNumber: System.NetworkNumber, format: NetFormat] =
BEGIN
Format.NetworkNumber[OutputString, networkNumber, format, h];
END;
SocketNumber: PUBLIC PROCEDURE [
h: Window.Handle, socketNumber: System.SocketNumber, format: NetFormat] =
BEGIN
Format.SocketNumber[OutputString, socketNumber, format, h];
END;
-- Private procedure
OutputString: Format.StringProc =
BEGIN
IF clientData # NIL THEN ERROR;
OthelloDefs.WriteString[s];
END;
-- Mainline Code
END.