Visual Basic 2005在語言上的增強(十三)顯式的數組範圍及小結

來源:互聯網
上載者:User
visual|數組 顯式的數組範圍

你現在可以使用顯式的數組範圍來聲明數組,這樣的聲明更加清晰可讀了:
Dim a(10) As Integer '舊方式
Dim b(0 To 10) As Integer '新方式

Visual Basic中的數組範圍仍然是以零為起始,所以如果你想聲明一個不是以零為起始範圍的數組,你就會得到一個編譯器錯誤。

小結

Visual Basic 2005語言獲得了一些重要的特性以及諸多細微的增強,這些都極大地提高了它的易用性和開發人員的生產效率。這個語言變得更加完善,並且和C#的不少主要特性也更好地對應起來,諸如XML注釋和操作符重載。

把IDE上不勝枚舉的增強功能考慮進去,Visual Basic 2005將會是Visual Basic所有的已發行版本中最強大的一款。不但從語言特性方面得到了增強,而且使用它簡直充滿了純粹的樂趣。現在唯一令我遺憾的是我還無法使用Visual Basic 2005建立生產應用程式。你也來試爽一下Beta版吧,我想你會同意我的觀點的。

譯後記

譯完了Stan Schultes先生的《Language Enhancements in Visual Basic 2005》系列文章,覺得總算做完了一件挺大的事情。在這裡涕淌要感謝所有來涕淌居閱讀這些文章並提出各種尖銳意見的網友們,謝謝你們!唉~~~無論多麼華麗的辭藻都無法表達涕淌對Visual Basic的愛意。2005年到來了,讓我們一起祝福她吧!


@以下是原文供網友們參考@

Explicit Array Bounds

You can now declare arrays using explicit array bounds to make the declaration clearer:
Dim a(10) As Integer 'old way
Dim b(0 To 10) As Integer 'new way

Array bounds in Visual Basic are still zero-based, so you'll get a compiler error if the array lower bounds value isn't 0.

Conclusion

The Visual Basic 2005 language gains several major features and many smaller enhancements that together provide significant increases in ease of use and developer productivity. The language has become more complete, and there is more parity with C# on major features like XML comments and operator overloading.

Coupled with a myriad of IDE enhancements, Visual Basic 2005 is poised to be the best version of Visual Basic ever released. Not only better from a language feature standpoint, but it's also a sheer joy to use. I'm disappointed only because I can't build production applications with the Visual Basic 2005 today. Give the Beta version a try, and I think you'll agree.



相關文章

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

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

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