Spooler Plus Programmer's Guide

Sample Perusal Process
Spooler Plus Programmers Guide522293-003
B-6
.device;
BEGIN
STRING str [0:79] := 80*[" "],
comstr [0:7] := 8 * [" "];
INT temp, ptr, count, status,devcnt;
SUBPROC error (errcode);
INT errcode;
BEGIN
CALL err(errcode);
command := 0;
END;
str[0] := "_";
CALL WRITEREAD (termnum, str, 1, 80,count);
IF <> THEN CALL filerr(termnum)
ELSE
BEGIN
! Remove leading spaces from command line
WHILE str [0] = " " AND count > 0 DO
BEGIN
str [0] ':=' str[1] FOR count;
count := count-1;
END;
temp := breakstr (str, 0, comstr);
IF temp <> 0 THEN CALL error(1)
ELSE
BEGIN
! Remove command from command line
WHILE str [0] <> " " AND str [0] <> %15 AND count > 0 DO
BEGIN
str [0] ':=' str[1] FOR count;
count := count-1;
END;
! Remove spaces between command and parameters
WHILE str [0] = " " AND count > 0 DO
BEGIN
str [0] ':=' str[1] FOR count;
count := count-1;
END;
command := getcom(comstr);
! Remove parameters from str
CASE command OF
BEGIN
! 0 Bad Command !
CALL error(1);
!1 LOC! BEGIN
location[0] := " ";
location[1] ':=' location[0] FOR 7;
IF count = 0 THEN location ':=' "#DEFAULT"
ELSE
BEGIN
temp := breakstr(str, 0, location);
IF temp < 0 THEN CALL error (2)
ELSE IF temp > 0 THEN
BEGIN
temp := temp + 1;
temp := breakstr(str, temp, location[4]);
IF temp <> 0 THEN CALL error (2);
END;
END;
END;
!2 HOLD! BEGIN