If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

A big thank you.

"Do I understand it correctly? I have the divedie the value of the file attribute by 32. If the remainder is 1 then the file is an Archive file. In other case no action."

That quick method of dividing only works for read-only. I would suggest just using the subcode getatttr and then testing if #23 = 0 or 1 for the archive attribute.

Scott

Scott

Hi,

A belated big thank you for pointing out that the "dividing and finding the remainder" method for finding the file attribute only works for the read only attribute special case. This is certainly a subtle point, since the procedure does work in the general case, but it fails to give the right answer.

I went back to the on-line Vedit Macro Language manual and studied the description of the File_Attribute command.
It gives an elaborate description of the various attribute parameters, via the Mask_i parameters. My problem was that I do not know the definition of the mask parameters.

Studying your e-mails I came up with the following definition: The Mask_i parameter for a given positive number N is the coefficient of 2^i in the binary expansion of N. I have a hunch that computer scientists refer to this number as the i-th bit of N.

Having said this, it is easy to check the cool formula,

Mask_i(N) = N & i, for i=0,1,2,4,8,..

Here of course, Mask_i(N) is the Mask_i parameter of N and & is the Bitwise AND operator of Appendix C of the Vedit Macro Language Manual.

I wonder where does the formula come from. I have a vague recollection that I have learned it from Pauli, but could not find the reference. So, if Pauli would help me out, I would appreciate it.

Hi,
Studying your e-mails I came up with the following definition: The Mask_i parameter for a given positive number N is the coefficient of 2^i in the binary expansion of N. I have a hunch that computer scientists refer to this number as the i-th bit of N.

Having said this, it is easy to check the cool formula,

Mask_i(N) = N & i, for i=0,1,2,4,8,..

Here of course, Mask_i(N) is the Mask_i parameter of N and & is the Bitwise AND operator of Appendix C of the Vedit Macro Language Manual.

I wonder where does the formula come from. I have a vague recollection that I have learned it from Pauli, but could not find the reference. So, if Pauli would help me out, I would appreciate it.
-peter

There is no such thing as "Mask_i parameter". The term mask or bitmask is used to refer a value that is used to separate specific bit(s) from a numeric value using AND operation.

The code does not refer to any program. You can copy and execute the code example as it is. It displays whether or not Archive attribute is on in the file you have currently open.
For more information of file attributes, search for FileAttrib in Vedit Help index.

The code does not refer to any program. You can copy and execute the code example as it is. It displays whether or not Archive attribute is on in the file you have currently open.
For more information of file attributes, search for FileAttrib in Vedit Help index.

Thanks Pauli,

I did follow up your Vedit Help index reference. This is that I found:

Return -1 if 'file' does not exist.
---------------------------------------------------------------------------------------------------

So, based on the above and based on my previous Lambert-Lindgren tutoring I gleaned the following definition for my personal use:
------------------------------------------------------------------------------------------------------------------------------
DEFINITION: We say that the Archive attribute of a given file, say "file" , is set if: