[VB6 ] 連續循環數的出現

看板Visual_Basic作者 (單眼皮)時間19年前 (2007/03/24 17:20), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/5 (看更多)
我想寫一個在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 stormbird:轉錄至看板 T108 03/24 21:42
文章代碼(AID): #161ErJsM (Visual_Basic)
討論串 (同標題文章)
文章代碼(AID): #161ErJsM (Visual_Basic)