问一个简单的VB程序问题!

来源:百度知道 编辑:UC知道 时间:2024/07/08 09:26:06
请各位朋友帮帮忙,解释一下该语句,我是一个初学VB者!谢谢!

const yourname = "yumiko886"
const title = "爱情测试"
const question = "你最喜欢的人是谁?请在下面的方框中输入他(她)的名字。"
const info = "你在说谎!不要逃避,实话实说。"
const scend = "你说出了你的心扉,那就向他(她)表白吧!"
dim youranswer
do
youranswer = inputbox(question, title)
if youranswer <> yourname then msgbox info, vbinformation+vbokonly, title
loop until youranswer = yourname
msgbox scend, vbinformation+vbokonly, title

这个程序就是要让使用者说出 最喜欢的人是"yumiko886"的时候 才可以关闭

主要就是 下面这个循环

do
youranswer = inputbox(question, title)
if youranswer <> yourname then msgbox info, vbinformation+vbokonly, title
loop until youranswer = yourname

loop until youranswer = yourname 这个是循环退出的条件 只有当回答的内容等于yourname这个变量的时候("yumiko886") 才退出

靠~!竟然也有人做这个东西啊~!