home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / programming / basic / blitzandpieces / flushlib.asc < prev    next >
Encoding:
Text File  |  1999-05-14  |  860 b   |  26 lines

  1. ; jamesboyd@all-hail.freeserve.co.uk
  2.  
  3. ; flushes specified library if possible :
  4.  
  5. a$=Peek.s(GetArgStr_())       ; CLI string (eg. stc.library)
  6. a$=Left$(a$,Peek.l(&a$-4)-1)  ; strip off chr$(10/13?)
  7.  
  8. If a$                         ; if we got a string...
  9.  
  10.   *exec.ExecBase=Peek.l(4)    ; get execbase
  11.   *mylist.List=*exec\LibList  ; get library list
  12.  
  13.     Forbid_                   ; hold everything!
  14.  
  15.       *libnode.Node=FindName_ (*mylist,&a$) ; find library name
  16.       If *libnode                           ; got it
  17.         RemLibrary_ *libnode                ; ask it to f*** off
  18.       EndIf                                 ; (might refuse!)
  19.  
  20.     Permit_                   ; hand system back without its library,
  21.                               ; like a "just-neutered" dog waking up :
  22. EndIf                         ; "Oh my God! Where are my libraries?!"
  23.  
  24. End
  25.  
  26.