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

ASP.NET
ASP.NET在上传文件时对文件类型的高级判断的代码
JQuery运用ajax注册用户实例(后台asp.net)
Asp.net与SQLserver一起打包部署安装图文教程
asp.net 上传下载输出二进制流实现代码
asp.net(C#)解析Json的类代码
asp.net 截取字符串代码
asp.net ubb使用代码
asp.net XML文件操作实现代码
asp.net利用HttpModule实现防sql注入
ASP.NET(C#)中操作SQLite数据库实例
asp.net(c#)ref,out ,params的区别
asp.net(C#)防sql注入组件的实现代码
asp.net FCKeditor自定义非空验证
Asp.net TreeView来构建用户选择输入的方法 推荐
asp.net(C#)函数对象参数传递的问题
Asp.net中的GridView导出遇到的两个问题和解决方法
asp.Net 中获取一周第一天,一月第一天等实现代码
asp.net MaxLengthValidator 最大长度验证控件代码
C# 通用文件上传类
asp.net 自定义控件实现无刷新上传图片,立即显示缩略图,保存图片缩略图

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 34 ::
收藏到网摘: 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.