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]  REFERENCE 
ALIAS  DESCRIPTOR64 [3]  REFERENCE32 [3] 
ARRAY_VISUALIZER [2]  DLLEXPORT [2]  REFERENCE64 [3] 
C  DLLIMPORT [2]  STDCALL 
DEFAULT  EXTERN  VALUE 
DESCRIPTOR [3]  NO_ARG_CHECK  VARYING 

[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  Yes[4]  Yes  Yes 
DLLIMPORT  Yes  Yes  Yes 
EXTERN  Yes  No  No 
NO_ARG_CHECK  Yes  No  Yes[5] 
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.
[4] Module-level variables and arrays only.
[5] This property cannot be applied to EXTERNAL statements.

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