home *** CD-ROM | disk | FTP | other *** search
- page
-
- ; RCP-ERA.Z80 'ERA' Command
-
- ;=============================================================================
- ;
- ; E R A S E C O M M A N D
- ;
- ;=============================================================================
-
- ;Command: ERA
- ;Function: Erase files
- ;Forms:
- ; ERA <afn> Erase Specified files and print their names
- ; ERA <afn> I Erase Specified files and print their names, but ask
- ; for verification before Erase is done
-
- era:
- call retsave
- ld a,(fcb2+1) ; Get eraflg if it's there
- ld (eraflg),a ; Save it as a flag
- ld a,1 ; Dir files only
- call getdir ; Load directory of files
- jp z,prfnf ; Abort if no files
- ;
- ; MAIN ERASE LOOP
- ;
- era1:
- call break ; See if user wants to stop
- push hl ; Save ptr to file
- call prfn ; Print its name
- ld (nxtfile),hl ; Save ptr to next file
- pop hl ; Get ptr to this file
- call rotest ; Test file pted to by hl for r/o
- jr nz,era3
- eraflg equ $+1 ; Address of flag
- ld a,0 ; 2nd byte is flag
- cp 'I' ; Is it an inspect option?
- jr nz,era2 ; Skip prompt if it is not
- call eraq ; Erase?
- jr nz,era3 ; Skip if not
- era2:
- ld de,fcb1+1 ; Copy into fcb1
- ld b,11 ; 11 bytes
- call blkmov
- call initfcb1 ; Init fcb
- ld c,19 ; Delete file
- call bdos
- era3:
- ld hl,(nxtfile) ; Hl pts to next file
- ld a,(hl) ; Get char
- or a ; Done?
- if erasp and spaceon
- jp z,spaexit
- else
- jp z,exit
- endif ; Erasp and spaceon
- call crlf ; New line
- jr era1
-
- ; End RCP-ERA.Z80
-
-