home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
lilith
/
m2set.mod
< prev
next >
Wrap
Text File
|
2020-01-01
|
14KB
|
530 lines
IMPLEMENTATION MODULE KermSet;
(************************************************************************)
(* Set changes the value of any local parameter *)
(* written: 09.10.85 Matthias Aebi *)
(* last modification: 18.03.86 Matthias Aebi *)
(************************************************************************)
FROM KermMisc IMPORT SetBaud, StringToCard;
FROM KermParam IMPORT LBaudRate, LCheckType, LCurrPort, LEcho, LEOLChar,
LEscChar, LFileType, LFilNamConv, LMaxRetries,
LNumOfPad, LPackSize, LPadChar, LParity, LPrefChar,
LQuoteChar, LStartChar, LTimeOut, LTimer,LDebug,
LWarning, LPrompt, ParityTyp, FileTyp;
FROM Terminal IMPORT WriteString, WriteLn;
FROM String IMPORT Copy;
FROM M2Kermit IMPORT Param1, Param2;
(************************************************************************)
PROCEDURE Set;
(************************************************************************)
VAR
displayParam : BOOLEAN;
displayValue : BOOLEAN;
paramCard : CARDINAL;
BEGIN
displayParam := FALSE;
displayValue := FALSE;
CASE CAP(Param1[0]) OF
"?": (* Help *)
displayParam := TRUE; |
"B": (* Baud Rate *)
(* If Param2 is a ?, StringToCard returns FALSE *)
IF NOT StringToCard(Param2, paramCard)
THEN
displayValue := TRUE;
ELSE
IF (paramCard<> 300) AND (paramCard<> 600) AND
(paramCard<> 1200) AND (paramCard<>2400) AND
(paramCard<> 4800) AND (paramCard<>9600) AND
(paramCard<>19200)
THEN
WriteString("Undefined baud rate");
displayValue := TRUE;
ELSE
LBaudRate := paramCard;
SetBaud(LBaudRate, LCurrPort);
END;
END;
IF displayValue
THEN
WriteLn;
WriteString("Available baud rates are:"); WriteLn;
WriteString(" 300 600 1200 2400 4800 9600 19200");
WriteLn;
END; |
"C": (* Check type *)
IF NOT StringToCard(Param2, paramCard)
THEN
displayValue := TRUE;
ELSE
IF NOT ((paramCard >= 1) AND (paramCard <= 3))
THEN
WriteString("Invalid check type");
displayValue := TRUE;
ELSE
LCheckType := paramCard;
END;
END;
IF displayValue
THEN
WriteLn;
WriteString("Available check types are:");
WriteLn;
WriteString(" 1 2 3");
WriteLn;
END; |
"D": (* Debug *)
CASE CAP(Param2[0]) OF
"?":
displayValue := TRUE; |
"O":
CASE CAP(Param2[1]) OF
"N":
LDebug := TRUE; |
"F":
LDebug := FALSE;
ELSE
displayValue := TRUE;
END;
ELSE
displayValue := TRUE;
END;
IF displayValue
THEN
WriteLn;
WriteString("Specify ON or OFF");
WriteLn;
END; |
"E":
CASE CAP(Param1[1]) OF
"N": (* EOL character *)
IF NOT StringToCard(Param2, paramCard)
THEN
displayValue := TRUE;
ELSE
IF paramCard > 127
THEN
WriteString("Invalid EOL character number");
displayValue := TRUE;
ELSE
LEOLChar := CHR(paramCard);
END;
END;
IF displayValue
THEN
WriteLn;
WriteString("Enter the EOL character as a number (0..127)");
WriteLn;
END; |
"S": (* Escape character *)
IF (Param2[0] = "?") OR (Param2[0] = 0C)
THEN
WriteLn;
WriteString("Enter the 'connect escape' character");
WriteLn;
ELSE
LEscChar := Param2[0];
END;
ELSE
WriteLn;
WriteString("Undefined parameter");
displayParam := TRUE;
END; |
"F": (* File Type *)
CASE CAP(Param2[0]) OF
"?":
displayValue := TRUE; |
"T":
LFileType := text; |
"B":
LFileType := binary;
ELSE
WriteLn;
WriteString("Undefined file type");
displayValue := TRUE;
END;
IF displayValue
THEN
WriteLn;
WriteString("Possible file types are:");
WriteLn;
WriteString(" Text Binary");
WriteLn;
END; |
"L": (* Local echo *)
CASE CAP(Param2[0]) OF
"?":
displayValue := TRUE; |
"O":
CASE CAP(Param2[1]) OF
"N":
LEcho := TRUE; |
"F":
LEcho := FALSE;
ELSE
displayValue := TRUE;
END;
ELSE
displayValue := TRUE;
END;
IF displayValue
THEN
WriteLn;
WriteString("Specify ON or OFF");
WriteLn;
END; |
"N": (* Name conversion *)
CASE CAP(Param2[0]) OF
"?":
displayValue := TRUE; |
"O":
CASE CAP(Param2[1]) OF
"N":
LFilNamConv := TRUE; |
"F":
LFilNamConv := FALSE;
ELSE
displayValue := TRUE;
END;
ELSE
displayValue := TRUE;
END;
IF displayValue
THEN
WriteLn;
WriteString("Specify ON or OFF");
WriteLn;
END; |
"P":
CASE CAP(Param1[1]) OF
"A":
CASE CAP(Param1[2]) OF
"C": (* PACket length *)
IF NOT StringToCard(Param2, paramCard)
THEN
WriteLn;
WriteString("Enter packet size");
WriteLn;
ELSE
LPackSize := paramCard;
END; |
"D":
CASE CAP(Param1[3]) OF
"C": (* PADChar *)
IF NOT StringToCard(Param2, paramCard)
THEN
displayValue := TRUE;
ELSE
IF paramCard > 127
THEN
WriteString("Invalid padding character number");
displayValue := TRUE;
ELSE
LPadChar := CHR(paramCard);
END;
END;
IF displayValue
THEN
WriteLn;
WriteString("Enter the padding character as a number (0..127)");
WriteLn;
END; |
"D": (* PADDing *)
IF NOT StringToCard(Param2, paramCard)
THEN
WriteLn;
WriteString("Enter number of padding characters");
WriteLn;
ELSE
LNumOfPad := paramCard;
END;
ELSE
WriteLn;
WriteString("Undefined parameter");
displayParam := TRUE;
END; |
"R": (* PARity *)
CASE CAP(Param2[0]) OF
"?":
displayValue := TRUE; |
"N":
LParity := none; |
"O":
LParity := odd; |
"E":
LParity := even; |
"M":
LParity := mark; |
"S":
LParity := space;
ELSE
WriteLn;
WriteString("Invalid parity");
displayValue := TRUE;
END;
IF displayValue
THEN
WriteLn;
WriteString("Available parity types are:");
WriteLn;
WriteString(" None Even Odd Space Mark");
WriteLn;
END;
ELSE
WriteLn;
WriteString("Undefined parameter");
displayParam := TRUE;
END; |
"O": (* POrt *)
IF NOT StringToCard(Param2, paramCard)
THEN
WriteLn;
WriteString("Enter port number");
WriteLn;
ELSE
LCurrPort := paramCard;
END; |
"R":
CASE CAP(Param1[2]) OF
"E": (* PREfix *)
IF (Param2[0] = "?") OR (Param2[0] = 0C)
THEN
WriteLn;
WriteString("Enter 8th bit prefix character");
WriteLn;
ELSE
LPrefChar := Param2[0];
END; |
"O": (* PROmpt *)
IF (Param2[0] = "?") OR (Param2[0] = 0C)
THEN
WriteLn;
WriteString("Enter the prompt to be used ");
WriteString("for M2-Kermit");
WriteLn;
ELSE
Copy(LPrompt, Param2, 0, HIGH(LPrompt));
END;
ELSE
WriteLn;
WriteString("Undefined parameter");
WriteLn;
displayParam := TRUE;
END;
ELSE
WriteLn;
WriteString("Undefined parameter");
displayParam := TRUE;
END; |
"Q": (* Quote *)
IF (Param2[0] = "?") OR (Param2[0] = 0C)
THEN
WriteLn;
WriteString("Enter quote character");
WriteLn;
ELSE
LQuoteChar := Param2[0];
END; |
"R": (* Retries *)
IF NOT StringToCard(Param2, paramCard)
THEN
WriteLn;
WriteString("Enter number of retries before timeout");
WriteLn;
ELSE
LMaxRetries := paramCard;
END; |
"S": (* Start of packet *)
IF NOT StringToCard(Param2, paramCard)
THEN
displayValue := TRUE;
ELSE
IF paramCard > 127
THEN
WriteString("Invalid padding character number");
displayValue := TRUE;
ELSE
LStartChar := CHR(paramCard);
END;
END;
IF displayValue
THEN
WriteLn;
WriteString("Enter the packet start character as a ");
WriteString("number (0..127)");
WriteLn;
END; |
"T":
CASE CAP(Param1[1]) OF
"I": (* TImer *)
CASE CAP(Param2[0]) OF
"?":
displayValue := TRUE; |
"O":
CASE CAP(Param2[1]) OF
"N":
LTimer := TRUE; |
"F":
LTimer := FALSE;
ELSE
displayValue := TRUE;
END;
ELSE
displayValue := TRUE;
END;
IF displayValue
THEN
WriteLn;
WriteString("Specify ON or OFF");
WriteLn;
END; |
"O": (* Time Out *)
IF NOT StringToCard(Param2, paramCard)
THEN
WriteString("Enter time out (seconds)");
WriteLn;
ELSE
LTimeOut := paramCard;
END;
ELSE
WriteLn;
WriteString("Undefined parameter");
WriteLn;
displayParam := TRUE;
END; |
"W": (* Warning *)
CASE CAP(Param2[0]) OF
"?":
displayValue := TRUE; |
"O":
CASE CAP(Param2[1]) OF
"N":
LWarning := TRUE; |
"F":
LWarning := FALSE;
ELSE
displayValue := TRUE;
END;
ELSE
displayValue := TRUE;
END;
IF displayValue
THEN
WriteLn;
WriteString("Specify ON or OFF");
WriteLn;
END;
ELSE
WriteLn;
WriteString("Undefined parameter");
WriteLn;
displayParam := TRUE;
END;
WriteLn;
IF displayParam
THEN
WriteLn;
WriteString("Choose one of the following:"); WriteLn;
WriteLn;
WriteString(" Baud rate PARity"); WriteLn;
WriteString(" Check type POrt "); WriteLn;
WriteString(" Debugging PREfix char"); WriteLn;
WriteString(" ENd of line char PROmpt"); WriteLn;
WriteString(" EScape character Quote char"); WriteLn;
WriteString(" File type Retries"); WriteLn;
WriteString(" Local echo Start of packet"); WriteLn;
WriteString(" Name conversion TImer"); WriteLn;
WriteString(" PACket Size Time Out"); WriteLn;
WriteString(" PAD Character Warning"); WriteLn;
WriteString(" PADDing"); WriteLn;
WriteLn;
END;
END Set;
END KermSet.