home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xco212p.zip / ISODEF / stextio.def < prev    next >
Text File  |  1994-12-22  |  2KB  |  56 lines

  1. DEFINITION MODULE STextIO;
  2.  
  3.   (* Input and output of character and string types over default channels. The read result
  4.      is of the type IOConsts.ReadResults.
  5.   *)
  6.  
  7.   (* The following procedures do not read past line marks *)
  8.  
  9. PROCEDURE ReadChar (VAR ch: CHAR);
  10.   (* If possible, removes a character from the default input stream, and assigns the
  11.      corresponding value to ch.  The read result is set to allRight, endOfLine or
  12.      endOfInput.
  13.   *)
  14.  
  15. PROCEDURE ReadRestLine (VAR s: ARRAY OF CHAR);
  16.   (* Removes any remaining characters from the default input stream before the next line
  17.      mark, copying to s as many as can be accommodated as a string value.  The read result
  18.      is set to the value allRight, outOfRange, endOfLine, or endOfInput.
  19.   *)
  20.  
  21. PROCEDURE ReadString (VAR s: ARRAY OF CHAR);
  22.   (* Removes only those characters from the default input stream before the next line mark
  23.      that can be accommodated in s as a string value, and copies them to s. The read result
  24.      is set to the value allRight, endOfLine, or endOfInput.
  25.   *)
  26.  
  27. PROCEDURE ReadToken (VAR s: ARRAY OF CHAR);
  28.   (* Skips leading spaces, and then removes characters from the default input stream before
  29.      the next space or line mark, copying to s as many as can be accommodated as a string
  30.      value.  The read result is set to the value allRight, outOfRange, endOfLine, or
  31.      endOfInput.
  32.   *)
  33.  
  34.   (* The following procedure reads past the next line mark *)
  35.  
  36. PROCEDURE SkipLine;
  37.   (* Removes successive items from the default input stream up to and including the next
  38.      line mark or until the end of input is reached. The read result is set to the value
  39.      allRight, or endOfInput.
  40.   *)
  41.  
  42.  
  43.   (* Output procedures *)
  44.  
  45. PROCEDURE WriteChar (ch: CHAR);
  46.   (* Writes the value of ch to the default output stream. *)
  47.  
  48. PROCEDURE WriteLn;
  49.   (* Writes a line mark to the default output stream. *)
  50.  
  51. PROCEDURE WriteString (s: ARRAY OF CHAR);
  52.   (* Writes the string value of s to the default output stream. *)
  53.  
  54. END STextIO.
  55.  
  56.