;========================================================================================================================================== ; ; How to get the file RASH attribute status? ; ;------------------------------------------------------------------------------------------------------------------------------------------ ; Detlev Dalitz.20110311. ;========================================================================================================================================== ; Example 1. blnAttrR = 0 blnAttrA = 0 blnAttrS = 0 blnAttrH = 0 intAttr = FileAttrGetEx (wGetFilename ()) If intAttr & 1 Then blnAttrR = 1 If intAttr & 32 Then blnAttrA = 1 If intAttr & 4 Then blnAttrS = 1 If intAttr & 2 Then blnAttrH = 1 Drop (intAttr, blnAttrS, blnAttrR, blnAttrH, blnAttrA) ; Example 2. intAttr = FileAttrGetEx (wGetFilename ()) blnAttrR = (intAttr & 1 ) == 1 blnAttrA = (intAttr & 32) == 32 blnAttrS = (intAttr & 4 ) == 4 blnAttrH = (intAttr & 2 ) == 2 Drop (intAttr, blnAttrS, blnAttrR, blnAttrH, blnAttrA) ; Example 3. blnAttrR = 0 blnAttrA = 0 blnAttrS = 0 blnAttrH = 0 strAttr = FileAttrGet (wGetFilename ()) If StrSub (strAttr, 1, 1) == "R" Then blnAttrR = 1 If StrSub (strAttr, 2, 1) == "A" Then blnAttrA = 1 If StrSub (strAttr, 3, 1) == "S" Then blnAttrS = 1 If StrSub (strAttr, 4, 1) == "H" Then blnAttrH = 1 Drop (strAttr, blnAttrS, blnAttrR, blnAttrH, blnAttrA) ; Example 4. strAttr = FileAttrGet (wGetFilename ()) blnAttrR = StrSub (strAttr, 1, 1) == "R" blnAttrA = StrSub (strAttr, 2, 1) == "A" blnAttrS = StrSub (strAttr, 3, 1) == "S" blnAttrH = StrSub (strAttr, 4, 1) == "H" Drop (strAttr, blnAttrS, blnAttrR, blnAttrH, blnAttrA) ; Example 5. blnAttrR = 0 blnAttrA = 0 blnAttrS = 0 blnAttrH = 0 arrAttr = ArrayFromStr (FileAttrGet (wGetFilename ())) If arrAttr[0] == "R" Then blnAttrR = 1 If arrAttr[1] == "A" Then blnAttrA = 1 If arrAttr[2] == "S" Then blnAttrS = 1 If arrAttr[3] == "H" Then blnAttrH = 1 Drop (blnAttrS, blnAttrR, blnAttrH, blnAttrA, arrAttr) ; Example 6. arrAttr = ArrayFromStr (FileAttrGet (wGetFilename ())) blnAttrR = arrAttr[0] == "R" blnAttrA = arrAttr[1] == "A" blnAttrS = arrAttr[2] == "S" blnAttrH = arrAttr[3] == "H" Drop (blnAttrS, blnAttrR, blnAttrH, blnAttrA, arrAttr) ; Example 7. arrAttr = ArrayFromStr (FileAttrGet (wGetFilename ())) arrAttr[0] = arrAttr[0] == "R" arrAttr[1] = arrAttr[1] == "A" arrAttr[2] = arrAttr[2] == "S" arrAttr[3] = arrAttr[3] == "H" Drop (arrAttr) :CANCEL Exit