春天在哪里舞蹈教学版:VB小问题

来源:百度文库 编辑:高考问答 时间:2024/04/29 17:19:09
想问下,下边程序中的ST1~5是哪来的啊 其他代码中都没提到过
Private Sub FuncChangeAddr(ByVal st1 As String, ByVal st2 As String, ByVal st3 As String, ByVal st4 As String, ByVal st5 As String)
Dim strAddr As String
Dim ilen As Long
strAddr = st1 & st2 & st3 & st4 & st5
ilen = Len(strAddr)
Select Case ilen
Case 0:
TxtSend.Text = "01"
Case 2:
TxtSend.Text = "03" & " " & strAddr
Case 4:
TxtSend.Text = "04" & " " & Mid(strAddr, 1, 2) & " " & Mid(strAddr, 3, 2)
Case 6:
TxtSend.Text = "05" & " " & Mid(strAddr, 1, 2) & " " & Mid(strAddr, 3, 2) & " " & Mid(strAddr, 5, 2)
Case 8:
TxtSend.Text = "06" & " " & Mid(strAddr, 1, 2) & " " & Mid(strAddr, 3, 2) & " " & Mid(strAddr, 5, 2) & " " & Mid(strAddr, 7, 2)
Case 10:
TxtSend.Text = "07" & " " & Mid(strAddr, 1, 2) & " " & Mid(strAddr, 3, 2) & " " & Mid(strAddr, 5, 2) & " " & Mid(strAddr, 7, 2) & " " & Mid(strAddr, 9, 2)
End Select
接口?那他是怎么取值的呢~strAddr是有ST1~5组成,但是没看到有给他们取值啊~! 汗~ 不明白

ByVal st1 As String, ByVal st2 As String, ByVal st3 As String, ByVal st4 As String, ByVal st5 As String

这些就是st1-5的定义。。

接口不就是了么?

你这段程序写的是一个SUB 函数,
你程序的其它地方一定能找到调用这个FuncChangeAddr函数的语句,后面跟了5个参数。(,,,,)
这5个参数就是在你这段代码里面定义的。ByVal st1 As String,表示按值传参数,st1为string型的。