您的位置:首页 > 编程语言 > VB

[VB.NET]急!求助

2008-12-26 23:29 351 查看



<script type="text/javascript"><!--
google_ad_client = "pub-8333940862668978";
/* 728x90, 创建于 08-11-30 */
google_ad_slot = "4485230109";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

急!求助
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
__________________________________________________________________________
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vb.net string