VB怎么把结果赋值给变量
OpenApp.Path+"\Output\wang.txt"ForInputAs#1WhileNotEOF(1)LineInput#1,strlinez=z&strli...
Open App.Path + "\Output\wang.txt" For Input As #1
While Not EOF(1)
Line Input #1, strline
z = z & strline & vbCrLf
Wend
Close #1
Open App.Path + "\Output\li.txt" For Input As #1
While Not EOF(1)
Line Input #1, cc
f = f & cc & vbCrLf
Wend
Close #1
aa = z & f & vbCrLf
bb = Split(aa, vbCrLf)
For i = 0 To UBound(bb)
If Asc(Right(bb(i), 1)) > 0 Then
For j = 0 To UBound(bb)
If Left(bb(j), Len(bb(i)) + 1) = bb(i) & " " Then
MsgBox bb(j)
End If
Next j
Else
MsgBox bb(i)
End If
Next i
怎么把MsgBox bb(j)和MsgBox bb(i)得出得所有结果赋值给两个变量,比如把MsgBox bb(j)出来的所有结果赋值给cc,把MsgBox bb(i)得出得所有赋值给xx
这是我的两个文本第一个:
b
ba
bang 帮
cou 凑
cong 从
ch
第二个是:
b 1
ba 1
ch 0
这个代码的意思是当遇到拼音后面没有文字得时候就读取第二个文本里相对应的数字显示在结果里
应该是:
b 1
ba 1
bang 帮
cou 凑
cong 从
ch 0
我现在想把结果赋值给一个变量ss怎么弄啊 展开
While Not EOF(1)
Line Input #1, strline
z = z & strline & vbCrLf
Wend
Close #1
Open App.Path + "\Output\li.txt" For Input As #1
While Not EOF(1)
Line Input #1, cc
f = f & cc & vbCrLf
Wend
Close #1
aa = z & f & vbCrLf
bb = Split(aa, vbCrLf)
For i = 0 To UBound(bb)
If Asc(Right(bb(i), 1)) > 0 Then
For j = 0 To UBound(bb)
If Left(bb(j), Len(bb(i)) + 1) = bb(i) & " " Then
MsgBox bb(j)
End If
Next j
Else
MsgBox bb(i)
End If
Next i
怎么把MsgBox bb(j)和MsgBox bb(i)得出得所有结果赋值给两个变量,比如把MsgBox bb(j)出来的所有结果赋值给cc,把MsgBox bb(i)得出得所有赋值给xx
这是我的两个文本第一个:
b
ba
bang 帮
cou 凑
cong 从
ch
第二个是:
b 1
ba 1
ch 0
这个代码的意思是当遇到拼音后面没有文字得时候就读取第二个文本里相对应的数字显示在结果里
应该是:
b 1
ba 1
bang 帮
cou 凑
cong 从
ch 0
我现在想把结果赋值给一个变量ss怎么弄啊 展开
4个回答
展开全部
Open App.Path + "\Output\wang.txt" For Input As #1
While Not EOF(1)
Line Input #1, strline
z = z & strline & vbCrLf
Wend
Close #1
Open App.Path + "\Output\li.txt" For Input As #1
While Not EOF(1)
Line Input #1, cc
f = f & cc & vbCrLf
Wend
Close #1
aa = z & f & vbCrLf
bb = Split(aa, vbCrLf)
For i = 0 To UBound(bb)
If Asc(Right(bb(i), 1)) > 0 Then
For j = 0 To UBound(bb)
If Left(bb(j), Len(bb(i)) + 1) = bb(i) & " " Then
MsgBox bb(j)
'-------------------------------------------
ss=ss & bb(j)
'-------------------------------------------
End If
Next j
Else
MsgBox bb(i)
'-------------------------------------------
ss2=ss2 & bb(i)
'-------------------------------------------
End If
Next i
While Not EOF(1)
Line Input #1, strline
z = z & strline & vbCrLf
Wend
Close #1
Open App.Path + "\Output\li.txt" For Input As #1
While Not EOF(1)
Line Input #1, cc
f = f & cc & vbCrLf
Wend
Close #1
aa = z & f & vbCrLf
bb = Split(aa, vbCrLf)
For i = 0 To UBound(bb)
If Asc(Right(bb(i), 1)) > 0 Then
For j = 0 To UBound(bb)
If Left(bb(j), Len(bb(i)) + 1) = bb(i) & " " Then
MsgBox bb(j)
'-------------------------------------------
ss=ss & bb(j)
'-------------------------------------------
End If
Next j
Else
MsgBox bb(i)
'-------------------------------------------
ss2=ss2 & bb(i)
'-------------------------------------------
End If
Next i
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询