Name

Declare Statement

Synopsis

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 optional; 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/objectaccess 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

Ansi optional; Keyword

Converts all strings to ANSI values.

Unicode optional; Keyword

Converts all strings to Unicode values.

Auto optional; 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 required; String literal

Any valid procedure name. Note that DLL entry points are case sensitive. If the aliasname argument is used, ...

Get VB.NET Language Pocket Reference 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.