Visual Studio.Net insider of 6

  • 2020-05-05 11:07:38
  • OfStack

Visual Basic changes

The characteristics of
Describe

Boolean and bit operator
And, Or, Xor, and Not are strict Boolean operators and can no longer be used for bit operations
. Instead, use BitAnd, BitOr, BitXor, and BitNot. Eqv and Imp are no longer supported.

Data type
Deftype statements (DefBool, DefByte, etc.) are no longer supported. Currency types are replaced by Decimal types. Dates is now stored as an integer of 8-byte to match the CLR DateTime type.

Dim, ReDim
You can no longer use ReDim in the initial array declaration. You must first declare the array with Dim. Then you can use ReDim to change the size of the array.

Integer
Short refers to the 16-bit signed integer. Integer (type string %) refers to 32-bit signed integer. Long (type string &) refers to 64-bit signed integer.

String
The string type now corresponds to the.NET Framework String class and cannot be modified after initialization. If the string must be modified, you can use the StringBuilder class.

Variable scope
Variables declared in a block are scoped to the block instead of the entire procedure. The scope of a variable declared in a procedure rather than in a block (that is, a statement group terminated by End, Loop, or Next) is the entire procedure.

Variants variable
Variant has been replaced by Object, but Variant is still a key word in the language.

Elements of Visual Basic 6.0 that are no longer supported in Visual Basic.NET.

As Any, Atn, Calendar, Circle, Currency, Date, Date$, Debug.Assert, Debug.Print, Deftype, DoEvents, Empty, Eqv, GoSub, Imp, Initialize, Instancing, IsEmpty, IsMissing, IsNull, IsObject, Let, Line, LSet, MsgBox, Now, Null, On...GoSub, On...GoTo, Option Base, Option Private Module, Property Get, Property Let, Property Set, PSet, Rnd, Round, RSet, Scale, Set, Sgn, Sqr, String, Terminate, Time, Time$, Timer, Variant, VarType, Wend.

Related articles: