PRMCLO.PAS/-AU=
{$E+ External procedure}
{$C
	.TITLE	PRMCLO
	.IDENT	"810708"
}
{
Change Status:

  DATE     BY      DESCRIPTION

08-JUL-81  KGT     Check to see if file has been opened or created properly 
                   before executing the record operation.  An available field
                   in the FAB (CTX) is set to a +1 if PRMOpe or PRMCre
                   was successful.
}
@[300,47]PRMCONST.PAS
TYPE
@[300,47]RMSTYPE.PAS
@fab.pas
@rab.pas
@[300,47]PRMTYPE.PAS


{ allow user to close without having the fabrec definition }
PROCEDURE PrmClo ( VAR Filebuf : RmsFileDesc ;
                   VAR Status  : RmsStatus ) ;
BEGIN
  IF FileBuf.Fab.Ctx = 1
    THEN
      BEGIN
        WITH FileBuf DO
          BEGIN
          {$C
            .mcall $close
            mov filebuf(sp), r0		; address of filebuf
            add #Fab, r0		; calc address of the fab in filebuf
            $close r0			; Close the file
          }
          END ;
        Status[1] := FileBuf.Fab.Sts ;
        Status[2] := FileBuf.Fab.Stv ;
      END 
    ELSE Status[1] := PrIni ;		{ file not properly initialized }
END ;
/
