Share via


3.3.5.3 Special Identifier Forms

 FOREIGN-NAME = "[" foreign-identifier "]" 
 foreign-identifier = 1*non-line-termination-character 

A <FOREIGN-NAME> is a token (section 3.3) that represents a text sequence that is used as if it was an identifier but which does not conform to the VBA rules for forming an identifier. Typically, a <FOREIGN-NAME> is used to refer to an entity (section 2.2) that is created using some programming language other than VBA.

Static Semantics

  • The name value (section 3.3.5.1) of a <FOREIGN-NAME> is the text of its <foreign-identifier>.

        BUILTIN-TYPE = reserved-type-identifier /  ("[" reserved-type-identifier "]") / "object" / "[object]" 
    

    In some VBA contexts, a <FOREIGN-NAME> whose name value is identical to a <reserved-type-identifier> can be used equivalently to that <reserved-type-identifier>.  The identifier whose name value is "object" is not a <reserved-identifier> but is generally used as if it was a <reserved-type-identifier>.

Static Semantics

  • The name value of a <BUILTIN-TYPE> is the text of its <reserved-type-identifier> element if it has one. Otherwise the name value is "object".

  • The declared type (section 2.2) of a <BUILTIN-TYPE> element is the declared type whose name is the same as the name value of the <BUILTIN-TYPE>.

    TYPED-NAME = IDENTIFIER  type-suffix 
     
    type-suffix = "%" / "&" / "^" / "!" / "#" / "@" / "$" 
    

A <TYPED-NAME> is an <IDENTIFIER> that is immediately followed by a <type-suffix> with no intervening whitespace.

Static Semantics

  • The name value of a <TYPED-NAME> is the name value of its <IDENTIFIER> elements.

  • The declared type of a <TYPED-NAME> is defined by the following table:

    <type-suffix>

    Declared Type

    %

    Integer

    &

    Long

    ^

    LongLong

    !

    Single

    #

    Double

    @

    Currency

    $

    String