Results 1 to 3 of 3

Thread: Visual Basic Script

  1. #1
    Join Date
    Jun 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Visual Basic Script

    Code:
    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:

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

    Code:
    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.

  2. #2
    Join Date
    Jun 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Turns out that I coded it wrong. Sorry for inconvienence.

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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).
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •