home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 451-475 / apd453 / protect.amos / protect.amosSourceCode
AMOS Source Code  |  1993-01-08  |  921b  |  26 lines

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