home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / amos_tips / protect / protect.amos / protect.amosSourceCode
Encoding:
AMOS Source Code  |  1992-03-02  |  1.0 KB  |  42 lines

  1. '***************************************** 
  2. '*              Protect.AMOS             * 
  3. '*       ï¿½1992 by Volker Stepprath       * 
  4. '*  Sets the protections-bits of a file  * 
  5. '***************************************** 
  6. '
  7. '**** Install protectionflag ****
  8. '
  9. MASKE$=Upper$("hsparwed")
  10. '
  11. '**** Choose file **** 
  12. '
  13. FILE$=Fsel$("","","Please choose file","to set the protectionbits !")
  14. '
  15. If FILE$<>""
  16.   '
  17.   FILE$=FILE$+Chr$(0)
  18.   '
  19.   '**** Get protectionbits ****  
  20.   '
  21.   If Instr(MASKE$,"D")=0 : Add BIT,1 : End If 
  22.   If Instr(MASKE$,"E")=0 : Add BIT,2 : End If 
  23.   If Instr(MASKE$,"W")=0 : Add BIT,4 : End If 
  24.   If Instr(MASKE$,"R")=0 : Add BIT,8 : End If 
  25.   If Instr(MASKE$,"A") : Add BIT,16 : End If 
  26.   If Instr(MASKE$,"P") : Add BIT,32 : End If 
  27.   If Instr(MASKE$,"S") : Add BIT,64 : End If 
  28.   If Instr(MASKE$,"H") : Add BIT,128 : End If 
  29.   '
  30.   '**** Set protectionflag ****
  31.   '
  32.   Dreg(1)=Varptr(FILE$)
  33.   Dreg(2)=BIT
  34.   XPROTECT=Doscall(-186)
  35.   '
  36.   '**** Error ? **** 
  37.   '
  38.   If XPROTECT=0 : Print "Error occured !" : Wait 50 : End If 
  39.   '
  40. End If 
  41. '
  42. Edit