当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > [译]Visual Basic 2005在语言上的增强(十三)显式的数组范围及小结

ASP.NET
asp.net GridView控件中模板列CheckBox全选、反选、取消
asp.net GridView 删除时弹出确认对话框(包括内容提示)
asp.net DropDownList 三级联动下拉菜单实现代码
asp DataTable添加列和行的三种方法
Asp.net 页面调用javascript变量的值
asp.net 长文章通过设定的行数分页
asp.net 定时间点执行任务的简易解决办法
asp.net 页面延时五秒,跳转到另外的页面
asp.net 动态输出透明gif图片
asp.net DataList与Repeater用法区别
asp.net Javascript获取CheckBoxList的value
asp.net程序在调式和发布之间图片路径问题的解决方法
asp.net下生成英文字符数字验证码的代码
asp.net 页面版文本框智能提示JSCode (升级版)
ASP.NET URL伪静态重写实现方法
ASP.NET 2.0 中Forms安全认证
asp.net 动态添加多个用户控件
asp.net Repeater显示父子表数据,无闪烁
asp.net 无法获取的内部内容,因为该内容不是文本 的解决方法
asp.net GridView排序简单实现

ASP.NET 中的 [译]Visual Basic 2005在语言上的增强(十三)显式的数组范围及小结


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 35 ::
收藏到网摘: n/a

显式的数组范围

你现在可以使用显式的数组范围来声明数组,这样的声明更加清晰可读了:
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.