Log in

View Full Version : Visual Basic Script



xAidanx
06-13-2007, 04:55 PM
Do
answer = InputBox("A question")
Loop Until answer = 10

I want to place a repeating message in my "Do..Loop Until" Loop saying "Sorry, that was incorrect. Please try again." but when i put it after the line "answer = InputBox("A question")" it plays at the end of my program. Can anyone help?

I have tried the following 2 methods:


Do
answer = InputBox("A question")
MsgBox("Sorry, that was incorrect. Please try again.")
Loop Until answer = 10

and


Do
answer = InputBox("A question")
If answer = <5 or >5 Then MsgBox("Sorry, that was incorrect. Please try again.")
Loop Until answer = 10

Both end up with the message being played at the end or during the programs running.

xAidanx
06-13-2007, 05:01 PM
Turns out that I coded it wrong. Sorry for inconvienence.

Twey
06-13-2007, 10:28 PM
Don't use VBScript. It's IE-only, and probably going to be phased out of that at some point too (no-one uses it client-side any more).