Appendix G. VB 6 Language Elements No Longer Supported


This appendix provides an alphabetical list of language elements that are present in VB 6 but are not supported by Visual Basic .NET 2002, or in subsequent versions of the language. Several math-related functions, formerly part of the Visual Basic language but now located in the System.Math namespace, are not included in this appendix.

Table G-1. VB 6 elements no longer supported

Element

Description

Array Function

Returns a variant array with elements that contain the values passed as arguments to the function

Any Keyword

Used in Declare statements to indicate generic parameter data types; all parameters must now have a declared data type

AscB Function

Returns an integer representing the character code of the first byte of a string

Atn Function

Returns the arctangent of a number; replaced by the Atan method in the System.Math class

Calendar Property

Determines whether a project should use the Gregorian or Hijri calendar; replaced by classes in the System.Globalization namespace

CCur Function

Converts an expression into a Currency data type

ChrB Function

Returns the character corresponding to an 8-bit character code

Circle Method

Draws circles on a form, PictureBox control, or other drawing surface; replaced by features in the System.Drawing namespace

Close Statement

Closes a file opened with the Open statement

Currency Data Type

Data type for accurate financial calculations; replaced by the Decimal data type

CVar Function

Converts an expression into a Variant data type

CVDate Function

Returns a Date variant

CVErr Function

Returns an error from a procedure

Date, Date$ Functions

Returns the current system date; replaced by the DateTime.Today property

Date Statement

Sets the current system date; replaced by the DateTime.Today property

Debug.Assert Statement

Conditionally suspends execution based on a Boolean test; consider replacement with the Debug.Assert method in the System.Diagnostics namespace

Debug.Print Statement

Sends output to the Immediate window; consider replacement with the Debug.WriteLine method and similar methods in the System.Diagnostics namespace

DefBool Statement

Defines all otherwise undeclared variables beginning with particular alphabetical characters as Boolean

DefByte Statement

Defines all otherwise undeclared variables beginning with particular alphabetical characters as Byte

DefCur Statement

Defines all otherwise undeclared variables beginning with particular alphabetical characters as Currency

DefDate Statement

Defines all otherwise undeclared variables beginning with particular alphabetical characters as Date

Defdbl Statement

Defines all otherwise undeclared variables beginning with particular alphabetical characters as Double

Defdec Statement

Defines all otherwise undeclared variables beginning with particular alphabetical characters as Decimal

Defint Statement

Defines all otherwise undeclared variables beginning with particular alphabetical characters as Integer

DefLng Statement

Defines all otherwise undeclared variables beginning with particular alphabetical characters as Long

Defobj Statement

Defines all otherwise undeclared variables beginning with particular alphabetical characters as Object

Defsng Statement

Defines all otherwise undeclared variables beginning with particular alphabetical characters as Single

Defstr Statement

Defines all otherwise undeclared variables beginning with particular alphabetical characters as String

DefVar Statement

Defines all otherwise undeclared variables beginning with particular alphabetical characters as Variant

DoEvents Statement

Releases control to the application's message queue; replaced with the DoEvents method in the Windows.Forms namespace, or in Visual Basic 2005 with the My.Application.DoEvents method

Empty Keyword

Indicates an empty or uninitialized data value; replaced by the Nothing keyword

Eqv Operator

Represents a logical equivalence operator; use the Equal To (=) comparison operator instead

Error Function

Returns a standard description of a particular error code

Get Statement

Retrieves data from a disk file into a program variable; replaced by the FileGet function

GoSub...Return Statement

Passes execution to, and returns from, a block subroutine within a procedure

Imestatus Function

Returns the state of the Input Method Editor, used for localized or specialized data input

Imp Operator

Represents a logical implication operator; use the expression "(Not A) Or B" instead

Initialize Event

Fires when an object is first used; use class constructors instead

InputB, InputB$ Functions

Reads a designated number of characters from a file opened in input or binary mode

Instancing Property

Defines how instances of a class are created; specify instancing in the class constructor instead

InStrB Function

Returns the position of a particular byte in a binary string

IsEmpty Function

Determines if a variable has been initialized; replaced by the IsNothing function

IsMissing Function

Determines whether an argument has been passed to a procedure

Isnull Function

Indicates whether an expression contains Null data; replaced by the IsDbNull function

IsObject Function

Indicates whether a variable contains a reference to an object; replaced by the IsReference function

LeftB, LeftB$ Functions

Returns the leftmost specified number of bytes of binary data

LenB Function

Returns the actual size of a user-defined type in memory

Let Statement

Assigns the value of an expression to a variable; simply assign values without the Let keyword

Line Input # Statement

Retrieves a single line from an input file into a variable; replaced by the LineInput function

Line Method

Draws lines or boxes on a form, PictureBox control, or other drawing surface; replaced by features in the System.Drawing namespace

Load Statement

Loads a form or control into memory for use

LoadResData Function

Extracts a string containing a resource included in a resource project; in Visual Basic 2005, use the My.Resources object

LoadResPicture Function

Assigns a graphic from a resource file to the Picture property of an object; in Visual Basic 2005, use the My.Resources object

LoadResString Function

Retrieves a string from a resource file; in Visual Basic 2005, use the My.Resources object

MidB, MidB$ Functions

Returns a specified number of bytes from a larger binary string

MidB Statement

Replaces a specified number of bytes in a binary string

MTSTransactionMode Property

Indicates whether a component is an MTS object and, if so, determines its level of transaction support

Name Statement

Renames a disk file or directory; replaced by the Rename function

Null Keyword

Indicates a Null data value; use the DBNull class in the System namespace

ObjPtr Function

Returns a pointer to an object

On...GoSub Statement

Causes program execution to jump to a block subroutine based on the value of a control variable

On...Goto Statement

Causes program execution to jump to a label based on the value of a control variable

Open Statement

Opens a file; replaced by the FileOpen function

Option Base Statement

Defines the default lower bound for arrays dimensioned within a module; all arrays now have a lower bound of 0

Option Private Module Statement

Restricts the scope and visibility of a module to the module's project; use access modifiers in each Module statement

Persistable Property

Determines whether a class in an ActiveX DLL project can be saved to disk

Property Statement

Declares procedures for read and write support of class property values; replaced with an updated Property statement syntax

PSet Method

Draws a colored point on a form, PictureBox control, or other drawing surface; replaced by features in the System.Drawing namespace

Put Statement

Writes data from a program variable to a disk file; replaced by the FilePut function

RightB, RightB$ Functions

Returns the rightmost bytes from a binary string

Scale Method

Defines a custom coordinate system on a form, PictureBox control, or other drawing surface; replaced by features in the System.Drawing namespace

Set Statement

Assigns an object reference to a variable; simply assign objects without the Set keyword

Sgn Function

Determines the sign of a number; replaced by the Sign method in the System.Math class

Sqr Function

Calculates the square root of a number; replaced by the Sqrt method in the System.Math class

String Function

Creates a string composed of a single character repeated a given number of times; replaced by special constructors on the String data type

StrPtr Function

Returns a pointer to a BSTR (Visual Basic string)

Terminate Event

Fires when an object is destroyed; use the Dispose and Finalize methods of a class instead

Time Function

Returns the current system time; replaced by the DateTime.TimeOfDay property

Time Statement

Sets the current system time; replaced by the DateTime.TimeOfDay property

Type Statement

Defines a user-defined type; replaced by the Structure statement (or even the Class statement)

Unload Statement

Removes a form or a dynamically created member of a control array from memory

Variant Data Type

Generic data type; use the Object or other relevant data type instead

VarPtr Function

Returns a pointer to a variable

Wend Keyword

Terminates a While loop block; replaced by the End While keyword pair

Width# Statement

Specifies a virtual file width when working with files opened with the Open statement





Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net