作者stormbird (单眼皮)
看板T108
标题[VB6 ] 连续循环数的出现
时间Sat Mar 24 21:42:04 2007
※ [本文转录自 Visual_Basic 看板]
作者: stormbird (单眼皮) 看板: Visual_Basic
标题: [VB6 ] 连续循环数的出现
时间: Sat Mar 24 17:20:18 2007
我想写一个在Text.text里面连续出现数字的一个东西
例如:我在Text1.text=48,Text2.text=51
而我要在Text3.text依序出现49,50,51
如果Text1.text=48,Text2.text=48
则Text3.text=48
我有先写出来,但是出现的都不是我想要
我这样写不知是否正确
请各位给我一点指教,指点指点我,谢谢
Dim n1 As Integer
Dim n2 As Integer
n1 = Val(Text1(0).Text)
n2 = Val(Text2(0).Text)
If n1 > n2 Then
For i = n1 To n2 Step -1
Text3(0).Text = ""
Text3(0).Text = i
Next i
ElseIf n1 < n2 Then
For i = n1 To n2 Step 1
Text3(0).Text = ""
Text3(0).Text = i
Next i
i = n1 = n2
Text3(0).Text = ""
Text3(0).Text = i
End If
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.126.20.53
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.126.20.53