     NOLIST
Exist       MACRO              ; 14 Jan 88
*------------------------------; Start of Exist macro.
     MOVE.L #-2,D2             ; Make D2 indicate the read accessMode.
     NOLIST
     IFC '\1','I'              ; If <PointerToFileName> is specified, then
     LIST
                               ; Put <PointerToFileName> in D1.
     MOVE.L #\2,D1
     NOLIST
     ENDC
     IFC '\1','D'              ; If <filename> is specified, then
     LIST
                               ; Make D1 point to <filename>.str .
     MOVE.L #\2.str,D1
     NOLIST
     IFND \2.str               ; Unless it was previously defined,
     LIST
     SECTION DataSection,DATA  ; The ASCII <filename> string goes here.
\2.str:
     DC.B '\2',0
     CNOP 0,2
     SECTION   "",CODE
     NOLIST
     ENDC
     ENDC
     LIST
     CallLib Lock,dos          ; Call Lock to get a lock on <filename>.
     MOVE.L D0,-(A7)           ; Save the lock which indicates existence.
     MOVE.L D0,D1              ; Unlock the file.
     CallLib UnLock,dos
     MOVE.L (A7)+,D0           ; Get the lock back.
     TST.L D0                  ; Make the zero flag indicate existence.
*------------------------------; End of Exist macro.
     ENDM
     LIST
