Trailing-Edge
-
PDP-10 Archives
-
decuslib20-03
-
decus/20-0078/libsim/findou.mac
There are 2 other files named findou.mac in the archive. Click here to see a list.
Comment * SIMULA specification;
OPTIONS(/E:CODE,findoutfile);
REF(Outfile)PROCEDURE findoutfile(filespec);
VALUE filespec; TEXT filespec;
COMMENT If an Outfile according to the specification can be opened,
then return a file ref, otherwise NONE;
! *;! MACRO-10 code *;!
TITLE findoutfile
SUBTTL SIMULA utility, Lars Enderin Oct 1975
;!*** Copyright 1975 by the Swedish Defence Research Institute. ***
;!*** Copying is allowed. ***
ENTRY findoutfile
sall
search simmac,simmcr,simrpa
macinit
result==ZBI%S
filespec==result+1
findoutfile:
PROC
EXEC CPNE ;! Allocate a file object
XWD 0,IOOU ;! Outfile prototype
SETON ZFIFND(XWAC1) ;! Flag special case
LD filespec(XCB) ;! Copy the parameter
STD OFFSET(ZFISPC)(XWAC1)
EXEC CSEN
IF ;! No luck
IFON ZIFEND(XWAC1)
GOTO FALSE
THEN ;! Close the channel etc
EXEC IOCL
ELSE
ST XWAC1,result(XCB)
SETOFF ZFIFND(XWAC1)
FI
BRANCH CSEP
EPROC
END;