[問題] vbs隨機取字

看板Web_Design作者 (版主對不起<(_ _)>)時間15年前 (2009/07/08 20:11), 編輯推噓0(003)
留言3則, 2人參與, 最新討論串1/1
不知道在.vbs中要怎麼寫呢? 就是我要隨機取字,取[2]或[3]或[空白] 有找到這個 http://www.study-area.org/coobila/tutorial_319.html Dim RandomInt Randomize RandomInt = Int((upperbound - lowerbound + 1) * Rnd + lowerbound) 但是不知道[空白]要怎麼加進去XD <(_ _)> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 58.114.202.165

07/08 21:04, , 1F
空白是指?
07/08 21:04, 1F

07/08 22:19, , 2F
就是比如取的變數叫做RandomInt,有三種可能
07/08 22:19, 2F

07/08 22:20, , 3F
RandomInt="2" 或 RandomInt="3" 或 RandomInt="" XDXDXD
07/08 22:20, 3F
想到了XD 謝謝大家 <(_ _)> Randomize RandomInt0 = Int((3 - 1 + 1) * Rnd + 1) If RandomInt0 = "1" Then RandomInt = "" elseif RandomInt0 = "2" Then RandomInt = RandomInt0 elseif RandomInt0 = "3" Then RandomInt = RandomInt0 End If ※ 編輯: tttp 來自: 58.114.202.165 (07/09 01:39)
文章代碼(AID): #1AL8pN3A (Web_Design)