Udostępnij za pośrednictwem


Programming Element Support Changes Summary

Support for various programming elements has changed since Visual Basic 6.0, mostly for interoperability with the common language runtime. Many Visual Basic 6.0 elements are renamed, reclassified, or combined with other programming elements. Several elements are no longer supported, because the common language runtime (CLR) includes functionality that makes them unnecessary. For more information, see Common Language Runtime.

For additional information about changes to Visual Basic, see Help for Visual Basic 6.0 Users. This topic includes information about changes to the integrated development environment (IDE), Web functionality, projects, forms, constants, and the Circle, Line, and Pset methods.

Changed Elements

The following table lists changed programming elements and their replacements.

Visual Basic 6.0 programming element

Visual Basic 2008 equivalent

Namespace, class, or run-time library location

Abs function

Abs Method

System Namespace, Math Class

AscB function

Asc Function

Visual Basic Run-Time Library Members, Strings module

As Any keyword phrase

Not supported in Visual Basic 2008. See Declaration Syntax for Visual Basic 6.0 Users.

Does not apply

Atn function

Atan Method

System Namespace, Math Class

Calendar property

CurrentCulture Property

System.Globalization Namespace, CultureInfo Class

ChDir statement

ChDir Function

Visual Basic Run-Time Library Members, FileSystem module

ChDrive statement

ChDrive Function

Visual Basic Run-Time Library Members, FileSystem module

Chr$,ChrB, functions

Chr Function

Visual Basic Run-Time Library Members, Strings module

Close statement

FileClose Function

Visual Basic Run-Time Library Members, FileSystem module

Cos function

Cos Method

System Namespace, Math Class

Currency data type

Decimal Data Type; see Data Type Changes for Visual Basic 6.0 Users

Visual Basic Run-Time Library Members, VariantType Enumeration

CVDate function

DateValue Function

Visual Basic Run-Time Library Members, DateAndTime module

CVErr function

Error Statement

Does not apply

Date function, Date statement

Now Property, Today Property

Visual Basic Run-Time Library Members, DateAndTime module

Date$ function

DateString Property

Visual Basic Run-Time Library Members, DateAndTime module

Debug.Assert method

Assert, Fail methods

System.Diagnostics Namespace, Debug Class

Debug.Print method

Write, WriteIf, WriteLine, and WriteLineIf methods

System.Diagnostics Namespace, Debug Class

Deftype statements

Not supported in Visual Basic 2008. See Data Type Changes for Visual Basic 6.0 Users

Does not apply

DeleteSetting statement

DeleteSetting Function

Visual Basic Run-Time Library Members, Interaction module

DoEvents function

DoEvents Method

System.Windows.Forms Namespace, Application Class

Empty keyword

Nothing

Does not apply

Eqv operator

= Operator; see Boolean Operator for Visual Basic 6.0 Users

Does not apply

Exp function

Exp Method

System Namespace, Math Class

FileCopy statement

FileCopy Function

Visual Basic Run-Time Library Members, FileSystem module

Get statement

FileGet Function

Visual Basic Run-Time Library Members, FileSystem module

GoSub statement

Not supported in Visual Basic 2008; use the Return Statement. See Control Statement for Visual Basic 6.0 Users.

Does not apply

Imp operator

Not supported in Visual Basic 2008. See Not and Or operators, and Boolean Operator for Visual Basic 6.0 Users.

Does not apply

Initialize event

Not supported in Visual Basic 2008; use Sub New. See Class_Initialize Changes for Visual Basic 6.0 Users and Using Constructors and Destructors

Does not apply

Input #, Input$ statements, Input$, InputB, InputB$ functions

Input Function

Visual Basic Run-Time Library Members, FileSystem module

Instancing property

Not supported in Visual Basic 2008. For class-level declarations, see Private (Visual Basic) and Public (Visual Basic). For procedure-level declarations, see Shared (Visual Basic).

Does not apply

InStrB function

InStr Function

Visual Basic Run-Time Library Members, Strings module

IsEmpty function

IsNothing Function

Visual Basic Run-Time Library Members, Information module

IsMissing function

Not supported in Visual Basic 2008. See Procedure Declaration for Visual Basic 6.0 Users.

Does not apply

IsNull function

IsDbNull Function

Visual Basic Run-Time Library Members, Information module

IsObject function

IsReference Function

Visual Basic Run-Time Library Members, Information module

Kill statement

Kill Function

Visual Basic Run-Time Library Members, FileSystem module

LCase$ function

LCase Function

Visual Basic Run-Time Library Members, Strings module

Left$, LeftB, LeftB$ functions

Left Function

Visual Basic Run-Time Library Members, Strings module

LenB function

Len Function

Visual Basic Run-Time Library Members, Strings module

Let, Set assignment statements

Not supported in Visual Basic 2008; the new Set statement is unrelated to the older one. See Default Property Changes for Visual Basic 6.0 Users.

Does not apply

Line Input # statement

LineInput Function

Visual Basic Run-Time Library Members, FileSystem module

Load statement

New (Visual Basic) keyword, Show method, Load event

Visual Basic Run-Time Library Members, System.Windows.Forms namespace

Lock statement

Lock, Unlock Functions

Visual Basic Run-Time Library Members, FileSystem module

Log function

Log Method

System Namespace, Math Class

LSet, RSet statements

LSet Function, PadRight, PadLeft; see Data Type Changes for Visual Basic 6.0 Users

Visual Basic Run-Time Library Members, Strings module; and System Namespace, String Class

LTrim$ function

LTrim Function

Visual Basic Run-Time Library Members, Strings module

MidB function

Mid Function

Visual Basic Run-Time Library Members, Strings module

MidB statement

Mid Statement

Visual Basic Run-Time Library Members, Strings module

MkDir statement

MkDir Function

Visual Basic Run-Time Library Members, FileSystem module

Name statement

Rename Function

Visual Basic Run-Time Library Members, FileSystem module

Now function

Now Property

Visual Basic Run-Time Library Members, DateAndTime module

Null keyword

Nothing

Does not apply

Oct$ function

Oct Function

Visual Basic Run-Time Library Members, Conversion module

On ... GoSub construction

Not supported in Visual Basic 2008; use Select...Case Statement. See Control Statement for Visual Basic 6.0 Users.

Does not apply

On ... GoTo construction

Not supported in Visual Basic 2008; use Select...Case Statement. See Control Statement for Visual Basic 6.0 Users.

Does not apply

Open statement

FileOpen Function

Visual Basic Run-Time Library Members, FileSystem module

Option Base statement

Not supported in Visual Basic 2008. See Array Bounds for Visual Basic 6.0 Users.

Does not apply

Option PrivateModule statement

Not supported in Visual Basic 2008; use Module Statement.

Does not apply

Print # statement

Print, PrintLine Functions

Visual Basic Run-Time Library Members, FileSystem module

Property Get, Property Let, Property Set statements

Not supported in Visual Basic 2008. See Property Procedure Changes for Visual Basic 6.0 Users.

Does not apply

Put statement

FilePut Function

Visual Basic Run-Time Library Members, FileSystem module

Reset statement

Reset Function

Visual Basic Run-Time Library Members, FileSystem module

Right$, RightB functions

Right Function

Visual Basic Run-Time Library Members, Strings module

RmDir statement

RmDir Function

Visual Basic Run-Time Library Members, FileSystem module

Round function

Round Method

System Namespace, Math Class

RSet, LSet statements

RSet Function; see Data Type Changes for Visual Basic 6.0 Users

Visual Basic Run-Time Library Members, Strings module

RTrim$ function

RTrim Function

Visual Basic Run-Time Library Members, Strings module

SaveSetting statement

SaveSetting Function

Visual Basic Run-Time Library Members, Interaction module

Scale method

Not supported in Visual Basic 2008.

Does not apply

Set, Let assignment statements

Not supported in Visual Basic 2008; the new Set statement is unrelated to the older one. See Default Property Changes for Visual Basic 6.0 Users

Does not apply

SetAttr statement

SetAttr Function

Visual Basic Run-Time Library Members, FileSystem module

Sgn function

Sign Function

System Namespace, Math Class

Sin function

Sin Method

System Namespace, Math Class

Sqr function

Sqrt Function

System Namespace, Math Class

String function

String Constructor; see String ($) Function for Visual Basic 6.0 Users

System Namespace, String Class

String ($) functions

Not supported in Visual Basic 2008. See String ($) Function for Visual Basic 6.0 Users.

Does not apply

Terminate event

Not supported in Visual Basic 2008; use Sub Dispose and Sub Finalize. See Using Constructors and Destructors.

Does not apply

Time function, Time statement

TimeOfDay Property; see DateTime Structure, Date Data Type

Visual Basic Run-Time Library Members, DateAndTime module

Time$ function

TimeString Property

Visual Basic Run-Time Library Members, DateAndTime module

Timer function

Timer Property

Visual Basic Run-Time Library Members, DateAndTime module

Trim$ function

LTrim, RTrim, and Trim Functions

Visual Basic Run-Time Library Members, Strings module

Type statement

Not supported in Visual Basic 2008; use Structure Statement. See Structure Declaration for Visual Basic 6.0 Users.

Does not apply

UCase$ function

UCase Function

Visual Basic Run-Time Library Members, Strings module

Unlock statement

Lock, Unlock Functions

Visual Basic Run-Time Library Members, FileSystem module

Variant data type

Object Data Type; see Universal Data Type Changes for Visual Basic 6.0 Users

Does not apply

Wend keyword

While...End While Statements and End Statement; see Control Statement for Visual Basic 6.0 Users

Does not apply

Width # statement

FileWidth Function

Visual Basic Run-Time Library Members, FileSystem module

Write # statement

Write, WriteLine Functions

Visual Basic Run-Time Library Members, FileSystem module

See Also

Other Resources

Language Changes for Visual Basic 6.0 Users

Help for Visual Basic 6.0 Users

Common Language Runtime