home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / intui.lha / AslFileWorkout < prev    next >
Encoding:
Text File  |  1992-09-02  |  845 b   |  58 lines

  1.  
  2. buttonpressed
  3.     bsr    AllocASL
  4.     bsr    OpenASLrequester
  5.     tst.l    d0
  6.     beq    np1
  7.  
  8. ; --------> Use Dos Library command delete
  9. ; --------> With fun routines
  10.  
  11.     
  12. ; --------> Has it got a file choosen?
  13.  
  14.     move.l    d0,a1                ;For later
  15.     move.l    d0,a0
  16.     tst.b    (a0)
  17.     beq    np1
  18.     
  19. ; --------> Find end of Volume or drive
  20.  
  21.     add.l    #256,a1
  22.     move.l    a1,d1
  23. lp1    cmp.b    #':',(a1)+    
  24.     beq    out
  25.     bra.s    lp1
  26.  
  27. ; --------> Is there a Directory?
  28.     
  29. out
  30.     tst.b    (a1)
  31.     beq.s    lp2
  32.     
  33. ; --------> Find End of Directory And Put '/' there
  34.  
  35.     bsr    charmove            ;Run character cal
  36.     move.b    #'/',-1(a1)            ;Put a slash there
  37.  
  38. ; --------> Bring File, Volume and Directory together
  39.     
  40. lp2    move.b    (a0)+,(a1)+
  41.     tst.b    -(a1)
  42.     beq    go_on
  43.     tst.b    (a1)+
  44.     beq    go_on
  45.     move.b    (a0)+,(a1)+
  46.     bra.s    lp2
  47.  
  48. ; --------> Do Delete
  49.     
  50. go_on
  51.     move.l    _DosBase,a6
  52.     jsr    DeleteFile(a6)    
  53.     tst.l    d0    
  54.     beq    file_error
  55.     
  56. np1    bsr    FreeASL
  57.     bra    test
  58.