6100 MPS-B Programming Manual
6100 MPS-B PROGRAMMING EXAMPLE
?PAGE "PROCEDURE: INITIALIZE"
PROC initialize;
BEGIN
LITERAL last^open = -1;
INT error,
.linename[0:11],
.recvname[0:11],
.termname[0:11];
CALL MYTERM (termname);
CALL OPEN (termname,termfnum); ! Open the home terminal.
IF < THEN CALL ABEND;
recvname ’:=’ ["$RECEIVE", 8 * [" "]];
CALL OPEN (recvname,recvfnum,,1); ! Open the $RECEIVE.
IF < THEN ! If OPEN call fails, log
CALL log^error (last^open); ! the FILE SYSTEM error,
! then ABEND.
CALL READUPDATE (recvfnum,linebuff,132);
CALL REPLY;
!:
! Open any required application files.
!:
linename ’:=’ ["$PDF9 ", 9 * [" "]];
CALL OPEN (linename,linefnum); ! Open the line.
IF < THEN ! If OPEN call fails, log
CALL log^error (last^open); ! the FILE SYSTEM error,
! then ABEND.
req^buff.req^id := 0; ! Initialize req^id.
IF configure^line <> 0 ! Assuming the line is not
THEN CALL error^exit; ! sysgened with AUTOCONF,
! let’s configure it. If
! configuration fails, call
! ABEND.
IF define^poll^lists <> 0 ! Define the poll/select and
THEN CALL error^exit; ! slow poll lists. If the
! poll lists cannot be
! defined, call ABEND.
CALL request (control, ! Connect the modem (raise
connect^modem); ! DTR).
IF status <> 0 ! If modem connect fails, call
THEN CALL error^exit; ! ABEND.
RETURN;
END; ! of initialize.
B-15