[VB.NET]急!求助

前端之家收集整理的这篇文章主要介绍了[VB.NET]急!求助前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
急!求助 Public Shared Sub main(Optional ByVal noform() As String ={ "true ","true "}) ................................... .................................. end sub 这样赋初值怎么不可以啊{ "true ","true "},为什么提示要表达式 请那位大哥指救 __________________________________________________________________________ VB不会哈! __________________________________________________________________________ 数组做为参数时,应该先声明好吧? __________________________________________________________________________ 数组不是常量,不能作为默认值。 你应该在函数内对 noform.Length = 0 进行判断,然后用默认值进行处理。 __________________________________________________________________________ 去掉Optional 关键字 Public Shared Sub main(ByVal noform() As String) __________________________________________________________________________ 你给行参赋值是不容许的。如果你想赋值,可以这么写: Public Shared Sub main(Optional ByVal noform() As String) noform() = { "true ","true "} ................................... .................................. end sub __________________________________________________________________________ 错了!不能那么赋值。不好意思。 Public Shared Sub main(Optional ByVal noform() As String) noform(0) = "true " noform(1) = "true " ................................... .................................. end sub __________________________________________________________________________ 原文链接:https://www.f2er.com/vb/264045.html

猜你在找的VB相关文章