Visual Basic 2005在語言上的增強(qiáng)(十三)顯式的數(shù)組范圍及小結(jié)
2024-07-21 02:22:53
供稿:網(wǎng)友
顯式的數(shù)組范圍
你現(xiàn)在可以使用顯式的數(shù)組范圍來聲明數(shù)組,這樣的聲明更加清晰可讀了:
dim a(10) as integer '舊方式
dim b(0 to 10) as integer '新方式
visual basic中的數(shù)組范圍仍然是以零為起始,所以如果你想聲明一個(gè)不是以零為起始范圍的數(shù)組,你就會(huì)得到一個(gè)編譯器錯(cuò)誤。
小結(jié)
visual basic 2005語言獲得了一些重要的特性以及諸多細(xì)微的增強(qiáng),這些都極大地提高了它的易用性和開發(fā)人員的生產(chǎn)效率。這個(gè)語言變得更加完善,并且和c#的不少主要特性也更好地對(duì)應(yīng)起來,諸如xml注釋和操作符重載。
把ide上不勝枚舉的增強(qiáng)功能考慮進(jìn)去,visual basic 2005將會(huì)是visual basic所有的已發(fā)行版本中最強(qiáng)大的一款。不但從語言特性方面得到了增強(qiáng),而且使用它簡(jiǎn)直充滿了純粹的樂趣?,F(xiàn)在唯一令我遺憾的是我還無法使用visual basic 2005創(chuàng)建生產(chǎn)應(yīng)用程序。你也來試爽一下beta版吧,我想你會(huì)同意我的觀點(diǎn)的。
譯后記
譯完了stan schultes先生的《language enhancements in visual basic 2005》系列文章,覺得總算做完了一件挺大的事情。在這里涕淌要感謝所有來涕淌居閱讀這些文章并提出各種尖銳意見的網(wǎng)友們,謝謝你們!唉~~~無論多么華麗的辭藻都無法表達(dá)涕淌對(duì)visual basic的愛意。2005年到來了,讓我們一起祝福她吧!
@以下是原文供網(wǎng)友們參考@
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.