home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-03-02 | 1.0 KB | 42 lines |
- '*****************************************
- '* Protect.AMOS *
- '* �1992 by Volker Stepprath *
- '* Sets the protections-bits of a file *
- '*****************************************
- '
- '**** Install protectionflag ****
- '
- MASKE$=Upper$("hsparwed")
- '
- '**** Choose file ****
- '
- FILE$=Fsel$("","","Please choose file","to set the protectionbits !")
- '
- If FILE$<>""
- '
- FILE$=FILE$+Chr$(0)
- '
- '**** Get protectionbits ****
- '
- If Instr(MASKE$,"D")=0 : Add BIT,1 : End If
- If Instr(MASKE$,"E")=0 : Add BIT,2 : End If
- If Instr(MASKE$,"W")=0 : Add BIT,4 : End If
- If Instr(MASKE$,"R")=0 : Add BIT,8 : End If
- If Instr(MASKE$,"A") : Add BIT,16 : End If
- If Instr(MASKE$,"P") : Add BIT,32 : End If
- If Instr(MASKE$,"S") : Add BIT,64 : End If
- If Instr(MASKE$,"H") : Add BIT,128 : End If
- '
- '**** Set protectionflag ****
- '
- Dreg(1)=Varptr(FILE$)
- Dreg(2)=BIT
- XPROTECT=Doscall(-186)
- '
- '**** Error ? ****
- '
- If XPROTECT=0 : Print "Error occured !" : Wait 50 : End If
- '
- End If
- '
- Edit