注册 登录
编程论坛 VB.NET论坛

请教如何给过程中的数组参数赋值

peterwjs 发布于 2019-07-26 14:50, 4125 次点击
如题 :
调用过程定义一个SC()的数组   
Public Sub ofxh(ByVal ks As Integer, ByVal js As Integer, ByVal sc() As String)
        For i = ks To js - 1
           msgbox(sc(i))        
        Next
    End Sub

调用OFXH:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        'datai()为已经赋值的动态数组,
       '如何调用OFXH过程,并给SC()赋值,实现外部的datai()的数据传给子程序的SC()数组
       call(0,200,???)
    End Sub
3 回复
#2
peterwjs2019-07-27 14:48
回复 楼主 peterwjs
没人答复
#3
deers2019-07-28 16:12
哈哈哈哈哈
#4
yanzhu63562019-07-31 08:38
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim lsc(10) As String
        For i = 1 To 10
            lsc(i) = i
        Next
        ofxh(1, 10, lsc)
    End Sub
    Public Sub ofxh(ByVal ks As Integer, ByVal js As Integer, ByVal sc() As String)
        For i = ks To js - 1
            MsgBox(sc(i))
        Next
    End Sub
1