15.1.3 ATTRIBUTES Directive

The ATTRIBUTES directive lets you specify properties for data objects and procedures. It takes the following form: [See Note]

 cDEC$ ATTRIBUTES att [,att]... :: object [,object]...
c
Is one of the following: C (or c), !, or * (see Section 15.1.1).
att
Is one of the following:

ADDRESS64 [1]  DESCRIPTOR32 [3]  REFERENCE32 [3] 
ALIAS  DESCRIPTOR64 [3]  REFERENCE64 [3] 
ARRAY_VISUALIZER [2]  DLLEXPORT [2]  STDCALL 
C  DLLIMPORT [2]  VALUE 
DEFAULT  EXTERN  VARYING 
DESCRIPTOR [3]  REFERENCE   

[1] VMS, WNT
[2] WNT, W9*
[3] VMS only

object
Is the name of a data object or procedure.

The following table shows which properties can be used with various objects:

Property  Variable and Array Declarations  Common Block Names [1]  Subprogram Specification
and EXTERNAL Statements
 
ADDRESS64  Yes  Yes  No 
ALIAS  No  Yes  Yes 
ARRAY_VISUALIZER[2] Yes  No  No 
C  No  Yes  Yes 
DEFAULT  No  Yes  Yes 
DESCRIPTOR  Yes[3]  No  No 
DESCRIPTOR32  Yes[3]  No  No 
DESCRIPTOR64  Yes[3]  No  No 
DLLEXPORT  No  Yes  Yes 
DLLIMPORT  No  Yes  Yes 
EXTERN  Yes  No  No 
REFERENCE  Yes  No  Yes 
REFERENCE32  Yes  No  No 
REFERENCE64  Yes  No  No 
STDCALL  No  Yes  Yes 
VALUE  Yes  No  No 
VARYING  No  No  Yes 

[1] A common block name is specified as [/]common-block-name[/]
[2] This property can only be applied to arrays.
[3] This property can only be applied to INTERFACE blocks.

These properties can be used in function and subroutine definitions, in type declarations, and with the INTERFACE and ENTRY statements.

Properties applied to entities available through use or host association are in effect during the association. For example, consider the following:

MODULE MOD1
  INTERFACE
    SUBROUTINE SUB1
    !DEC$ ATTRIBUTES C, ALIAS:'othername' :: NEW_SUB
    END SUBROUTINE
  END INTERFACE
  CONTAINS
    SUBROUTINE SUB2
    CALL NEW_SUB
    END SUBROUTINE
END MODULE

In this case, the call to NEW_SUB within SUB2 uses the C and ALIAS properties specified in the interface block.

The properties are described as follows:


Note: The following form is also allowed: !MS$ATTRIBUTES att [,att]... :: object [,object]...

For More Information:


Previous Page Next Page Table of Contents