Google
 

Trailing-Edge - PDP-10 Archives - mit_emacs_170_teco_1220 - info/sailio.doc
There are no other files named sailio.doc in the archive.
SAILIO has been  replaced by IOSAIL, which is easier  to use and more powerful.
Documentation is in DOC:IOSAIL.DOC.  To get the routines and macros use REQUIRE
"<SAIL>IOSAIL.HDR" SOURCE!FILE;

SAILIO is  still available  for  compatability with  older programs.  There  is
presently a  source file with some macros and  procedures designed to make SAIL
I/O  a little easier  for novices and  for more advanced  programmers who don't
want to  bother with the detail  of SAIL I/O.  You  can access those facilities
with the statement REQUIRE  "SYS:SAILIO.SAI" SOURCE!FILE; at the very beginning
of  your  SAIL  programs.   These  macros  and  procedures  are  documented  on
<DOCUMENTATION>SAILIO.DOC .

Also, for those who get tired of INTTY for reading from the terminal, there  is
a  better  input  routine  available.    Say  TYPE  <SAIL>RDTTY.DOC  for   more
information.  This is not necessary if IOSAIL is used.


    SYS:SAILIO.SAI contains source code with macros and
procedures designed to make SAIL input and output easier to
use both for the novice and for the more advanced programmer
who doesn't want to be bothered with the complications of SAIL
I/O.  You may use these macros and procedures in you SAIL
programs simply by saying
    REQUIRE "SYS:SAILIO.SAI" SOURCE!FILE
at the very beginning of your SAIL programs (right after the
first BEGIN).
    That source file makes the following macros available to
you which are designed to be used with the PRINT statement in
SAIL.
    MACRO       purpose
    NEWLINE     forces a new line of output when printed
    CRLF        same as NEWLINE
    CR          generates the character - carriage return
                    (printing this character will return the
                    cursor to the left side of the screen
                    without moving it to a new line.)
    LF          generates the character - line feed (printing
                    this character will move the cursor down
                    a line without moving it to the left of
                    the screen.)
    BELL        rings the bell if you print this character.
    TAB         tabs if you print this character.
    FORMFEED    generates a formfeed.
    SPACE       equivalent to " ".
    BACKSPACE   moves the cursor back one space.

The following procedures are available via SAILIO.SAI to make
input a little easier.  ASSIGN!CHANNEL is a pure procedure and
all other are functions.

PROCEDURE ASSIGN!CHANNEL(INTEGER CHAN;STRING FILE;
    INTEGER INPUT!BUFFERS(5);STRING DEVICE ("DSK"));
This procedure opens channel number CHAN as an input channel
INPUT!BUFFERS input buffers and specifies it as coming from
device DEVICE.  It then attempts to do a LOOKUP with than
channel and file FILE.  Basicly it just prepares file FILE for
input and associates channel number CHAN with that file.  Note
that INPUT!BUFFERS and DEVICE have default values sufficient for
most purposes and will normally not need to be specified.  Thus
to assign channel 5 with file "INPUT.DAT", one need only execute
    ASSIGN!CHANNEL(5,"INPUT.DAT");

STRING PROCEDURE READLINE(INTEGER CHAN (-1))
    This is a function procedure which will throw away all input
until it gets to the beginning of a line, then returns the
string of the input until the next carriage return line feed
is found.  I.e. it returns the next full line of input.  If CHAN
is -1 then READLINE goes to the terminal for its input first
printing a "-" prompt to inform the user that the program wants
some input.  Otherwise READLINE will try to get its input
from the file associated with CHAN.  Note that CHAN has a
default value of -1 so that if CHAN is not specified, it assumes
the input is to come from the terminal.  I.e. 
    S_READLINE;
will attempt to read a line from the terminal and store it in S.

STRING PROCEDURE READSTRING(INTEGER CHAN (-1))
    This follows the same conventions as READLINE but scans for
a string enclosed in quotes rather than an entire line.

REAL PROCEDURE READ(INTEGER CHSN (-1))
    This follows the same conventions as READLINE but scans for
a real number as defined by REALSCAN instead of an entire line.

INTEGER PROCEDURE READINTEGER(INTEGER CHSN (-1))
    This follows the same conventions as READLINE but scans for
a integer number as defined by INTSCAN instead of an entire
line.

    Note that READSTRING, READ, and READINTEGER will all ignore
any garbage it finds until it finds what it is looking for.

ENJOY!!!!!!!!



Comments  on this and other documentation, suggestions for improvement,
updates, and subsystem bugs, can be MAILed to DOCUMENTATION.  Just type

   @mm send
   TO: bug-doc