新人求助~一个调用过程的问题!到底哪里不对呀摔!!
程序代码:
Public Class Form1 Sub maxlength(ByVal s$, ByRef max$) Dim n$, i% s = LTrim(s) i = InStr(s, " ") Do While i <> 0 n = Mid(s, 1, i - 1) If Len(n) < Len(max) Then max = n s = Mid(s, i + 1) i = InStr(s, " ") Loop If Len(s) > Len(max) Then max = s End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim s, m As String s = TextBox1.Text Call maxlength(s, m) TextBox2.Text = m End Sub End Class
输入一堆字符串,用空格隔开,找出最长单词
摆脱哪位高手教教我到底哪里不对了呀?怎么也改不出来哭..