DELETE.I

[Table of Contents]


The DELETE.I include file resides on the Kyan Pascal 2.x Utilities Disk 1. It contains on function to delete a file from disk.


  •  function delete(f:pathstring):integer;


Source Code


function delete(f:pathstring):integer;
    var
        spec:pathstring;
    begin
        delete:=0;
        add_device(f,spec);
#a
    stx  dxsave
    ldx  #$10
dopn1 lda $340,x
    cmp #$ff
    beq dopn2
    txa
    clc
    adc #$10
    tax
    cpx #$80
    bne dopn1
    ldy #$81
    jmp dleave
dxsave db 0
dopn2 lda  #$21  ;delete command
    sta  $342,x
    clc
    lda  #5
    adc  _sp
    sta  $344,x
    lda  #0
    adc  _sp+1
    sta  $345,x
    jsr  $e456
dleave tya
    ldy  #25
    sta  (_sp),y
    ldx  dxsave
#
end;

No comments:

Post a Comment