Visual Studio.Net 內幕(6)

來源:互聯網
上載者:User

Visual Basic的變化

特點
描述

布耳和位元運算符
And, Or, Xor, 和 Not是嚴格的 Boolean 運算子而且不能再用於位元運算
。而應該使用 BitAnd, BitOr, BitXor, 和 BitNot。Eqv和Imp不再支援。

資料類型
Deftype語句 (DefBool, DefByte, 等等) 不再支援. Currency 類型被Decimal 類型取代。 Dates 現在被作為 8-byte 的整數進行儲存與 CLR DateTime 類型相匹配。

Dim, ReDim
你不能在初始的數組聲明中使用 ReDim了。你必須首先用Dim聲明這個數組。然後你可以使用 ReDim 來改變這個數組的大小。

整數
Short 指的是 16-bit 有符號整數。 Integer (類型字串為 %) 指的是 32-bit有符號整數. Long (類型字串為&)指的是64-bit有符號整數.

字串
字串類型現在與 .NET Framework String 類相對應, 在初始化後不能被修改.如果這個字串必須被修改,你可以使用 StringBuilder 類。

變數範圍
在程式塊中聲明的變數的範圍為程式塊而不是整個過程了。在過程而不是在程式塊中聲明的變數 (程式塊即由 End, Loop, 或者 Next結束的語句組) 的範圍是整個過程。

Variants變數
Variant已經為 Object所取代.但是 Variant仍然是這種語言中的關鍵詞。

Visual Basic .NET中不再支援的Visual Basic 6.0的元素。

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.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.