Name

Declare Statement

Syntax

Syntax for subroutines:

[accessmodifier] Declare [Ansi|Unicode|Auto] Sub name Lib "libname" _
    [Alias "aliasname"] [([arglist])]

Syntax for functions:

[accessmodifier] Declare [Ansi|Unicode|Auto] Function name _
   Lib "libname" [Alias "aliasname"] [([arglist])] [As type]
accessmodifier

Use: Optional

Type: Keyword

accessmodifier can be any one of the following: Public, Private, Protected, Friend, or Protected Friend. The following table describes the effects of the various access modifiers. Note that Direct Access refers to accessing the member without any qualification, as in:

classvariable = 100

and Class/Object Access refers to accessing the member through qualification, either with the class name or the name of an object of that class.

Direct Access scope

Class/Object Access scope

Private

Declaring class

Declaring class

Protected

All derived classes

Declaring class

Friend

Derived in-project classes

Declaring project

Protected Friend

All derived classes

Declaring project

Public

All derived classes

All projects

For more information, see Section 3.7 in Chapter 3.

Ansi

Use: Optional

Type: Keyword

Converts all strings to ANSI values.

Unicode

Use: Optional

Type: Keyword

Converts all strings to Unicode values.

Auto

Use: Optional

Type: Keyword

Converts the strings according to .NET rules based on the name of the method (or the alias name, if specified). If no modifier is specified, Auto is the default.

name

Use: Required

Type: String literal

Any valid ...

Get VB .NET Language in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.