O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 (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/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 4.7 in Chapter 4.

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required