Google
 

Trailing-Edge - PDP-10 Archives - bb-x130a-sb - fixctl.sno
There are no other files named fixctl.sno in the archive.
* Program to convert /VID switch syntax for Galaxy version 4
	&ANCHOR = 1
	&STLIMIT = 500000
	DEFINE("DEV(STRING)")
	DEFINE("FILE(STRING)")
	DEFINE("OUTSTR(STRING)")
*
	FILES = 0
	LINES = 0
	OUTSTR("Input command file name: ")
	CMDFILE = INPUT
	OUTSTR("Do you want to convert /VID into /REMARK (Y/N) [N]? ")
	ANSWER = INPUT
	SWITCH = "/VID:"
	SWITCH = ?IDENT(ANSWER,"Y") "/REMARK:"
	CMDCHN = OPEN(DEV(CMDFILE))		:F(FERROR)
	LOOKUP(FILE(CMDFILE),CMDCHN)		:F(FERROR)
	INPUT('CMDLIN',CMDCHN)
* setup for new file
NFILE	CMD = CMDLIN				:F(EOJ)
	DSKICHN = OPEN(DEV(CMD))		:F(FERROR)
	LOOKUP(FILE(CMD),DSKICHN)		:F(FERROR)
	DSKOCHN = OPEN(DEV(CMD))		:F(FERROR)
	ENTER(FILE(CMD),DSKOCHN)		:F(FERROR)
	INPUT('DSKILIN',DSKICHN)
	OUTPUT('DSKOLIN',DSKOCHN)
* loop for each line
NLINE	LINE = DSKILIN				:F(EOF)
	LINE BREAK("/") . P1 LEN(1) ANY("Vv") ANY("Ii") ANY("Dd") ":" ANY("""'")  BREAK("""'") . P2 LEN(1) REM . P3	:F(NLINE.1)
	LINES = LINES + 1
	DSKOLIN = P1 SWITCH '"' P2 '"' P3	:(NLINE)
NLINE.1	DSKOLIN = LINE				:(NLINE)
* process EOF of file
EOF	CLOSE(DSKICHN)				:F(FERROR)
	CLOSE(DSKOCHN)				:F(FERROR)
	FILES = FILES + 1			:(NFILE)
* process EOF of command file
EOJ	OUTPUT = "[Total of " FILES " files processed and " LINES " lines converted]"
						:(EXIT)
* errores
FERROR	OUTPUT = "?File I/O error"	:(EXIT)

*functions
*DEV(STRING) returns device name in STRING (DSK if none specified)
DEV	STRING BREAK(":") . DEV		:S(RETURN)
	DEV = "DSK"			:(RETURN)

*FILE(STRING) returns filename/PPN in string without device name
FILE	STRING BREAK(":") LEN(1) REM . FILE	:S(RETURN)
	FILE = STRING				:(RETURN)
*OUTSTR(STRING) outputs STRING w/o CRLF
OUTSTR	STRPTR = 0
OUT.LOP	OUTPUTC = SUBSTR(STRING,1,STRPTR)	:F(RETURN)
	STRPTR = STRPTR + 1			:(OUT.LOP)
EXIT	&ABEND = 1
	&OUTPUT = 0
END