7或Len(Trim" />
Dim a,即h作為字符串
私有子命令1_KeyPress(KeyAscii為整數)
使不規則化
i = Int(7 * Rnd + 1)
e = Int(9999999 * Rnd+1000000)
如果KeyAscii = 32,則
A = InputBox("妳好,請輸入數字","歡迎來到有獎項目","")
Do While Len(Trim(a))>7或Len(Trim(a))& lt;七
A = InputBox("數字大於或小於7位,請重新輸入數字","歡迎來到有獎項目","")
環
If (Mid(Trim(a),1,1) = Chr(48)或Mid(Trim(a),1,1) = Chr(49)或Mid(Trim(a),1,1) = Chr(50)或Mid(Trim(a),1,1) = Chr(51 1) = Chr(51)或Mid(Trim(a),2,1) = Chr(52)或Mid(Trim(a),2,1) = Chr(53)或Mid(Trim(a),2,1) = Chr(54)或Mid(Trim(a),2,1) = Chr(55)或Mid(Trim(a),2
和(Mid(Trim(a),4,1) = Chr(48)或Mid(Trim(a),4,1) = Chr(49)或Mid(Trim(a),4,1) = Chr(50)或Mid(Trim(a),4,1) = Chr(51)或Mid(Trim(a),4,1) = Chr(52 1) = Chr(51)或Mid(Trim(a),5,1) = Chr(52)或Mid(Trim(a),5,1) = Chr(53)或Mid(Trim(a),5,1) = Chr(54)或Mid(Trim(a),5,1) = Chr(55)或Mid(Trim(a),5
和(Mid(Trim(a),7,1) = Chr(48)或Mid(Trim(a),7,1) = Chr(49)或Mid(Trim(a),7,1) = Chr(50)或Mid(Trim(a),7,1) = Chr(51)或Mid(Trim(a),7,1) = Chr(52
如果Right(Trim(a),7) = Right(e,7),則
H = MsgBox("恭喜妳,妳中了大獎。",0,“獎”)
圖片1。打印Spc(2);“彩票號碼”&;e
圖片1。打印" & lt& lt& lt& lt& lt& lt& lt”& amp“妳的號碼”&;Trim(a)和amp" & gt& gt& gt& gt& gt& gt& gt大獎”
ElseIf Right(Trim(a),6) = Right(e,6)
H = MsgBox("恭喜妳,妳獲得了壹等獎。",0,“獎”)
圖片1。打印Spc(2);“彩票號碼”&;e
圖片1。打印" & lt& lt& lt& lt& lt& lt”& amp“妳的號碼”&;Trim(a)和amp" & gt& gt& gt& gt& gt& gt壹等獎”
ElseIf Right(Trim(a),5) = Right(e,5)
H = MsgBox("恭喜妳,妳獲得了二等獎。",0,“獎”)
圖片1。打印Spc(2);“彩票號碼”&;e
圖片1。打印" & lt& lt& lt& lt& lt”& amp“妳的號碼”&;Trim(a)和amp" & gt& gt& gt& gt& gt二等獎”
ElseIf Right(Trim(a),4) = Right(e,4)
H = MsgBox("恭喜妳,妳獲得了三等獎。",0,“獎”)
圖片1。打印Spc(2);“彩票號碼”&;e
圖片1。打印" & lt& lt& lt& lt”& amp“妳的號碼”&;Trim(a)和amp" & gt& gt& gt& gt三等獎”
ElseIf Right(Trim(a),3) = Right(e,3)
H = MsgBox("恭喜妳,妳獲得了四等獎。",0,“獎”)
圖片1。打印Spc(2);“彩票號碼”&;e
圖片1。打印" & lt& lt& lt”& amp“妳的號碼”&;Trim(a)和amp" & gt& gt& gt四等獎”
ElseIf Right(Trim(a),2) = Right(e,2)
H = MsgBox("恭喜妳,妳中了五等獎。",0,“獎”)
圖片1。打印Spc(2);“彩票號碼”&;e
圖片1。打印" & lt& lt”& amp“妳的號碼”&;Trim(a)和amp" & gt& gt五等獎”
ElseIf Right(Trim(a),1) = Right(e,1)則
H = MsgBox("恭喜妳,妳中了六等獎。",0,“獎”)
圖片1。打印Spc(2);“彩票號碼”&;e
圖片1。打印" <& amp“妳的號碼”&;Trim(a)和amp" & gt六等獎”
ElseIf Right(Trim(a),I)& lt;& gt那好吧
H = MsgBox("繼續努力,妳沒有得獎。"0,“沒中獎”)
圖片1。打印Spc(2);“彩票號碼”&;e
圖片1。打印“妳的號碼”&;Trim(a)和amp“沒中獎”
如果…就會結束
其他
H = MsgBox("只能輸入數字。",0,“錯誤”)
如果…就會結束
如果…就會結束
末端接頭