Changes in Visual Basic
Features
Description
Bucket and bitwise operators
And, Or, XOR, and not are strict boolean operators and cannot be used for bitwise operations.
. Bitand, bitor, bitxor, and bitnot should be used. Eqv and IMP are no longer supported.
Data Type
Deftype statements (defbool, defbyte, etc.) are no longer supported. The currency type is replaced by the decimal type. Dates is now stored as an 8-byte integer that matches the CLR datetime type.
Dim, redim
You cannot use redim in the initial array declaration. You must declare the array with dim first. Then you can use redim to change the size of the array.
Integer
Short refers to a 16-bit signed integer. INTEGER (type string: %) indicates a 32-bit signed integer. Long (type string: &) indicates a 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
InProgramThe scope of the variables declared in the block is the program block rather than the whole process. The scope of the variables declared in the process rather than in the program block (the program block is the statement group ending with end, loop, or next) is the whole process.
Variants variable
Variant has been replaced by object. However, variant is still a keyword in this 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.