Need a Little Bit of Help with a Batch File

Discussion in 'Computing, Science, and Technology' started by DarkWrath, Aug 17, 2009.

  1. DarkWrath

    DarkWrath Active Member

    Joined:
    Apr 17, 2009
    Messages:
    1,218
    Likes Received:
    0
    Device:
    4G iPod touch
    I've been having a bit of trouble with a batch file, I would like the batch file to present the user with a list of options. If the user does not pick x,v or z and enters something else (a, b or whatever), the batch file will return a message saying 'Incorrect Selection, Please try again'. Kind of like this:

    Code:
    Here are your options:
    x
    v
    z
    
    Enter your selection and press enter 
    [B][I]*user enters a*[/I][/B]
    Sorry, Incorrect Selection
    I have been trying to figure it out but have not been able to find it for the life of me. Any help would be appreciated.

    Thanks

    Please Register or Log in to view images

  2. Antonpup

    Antonpup Member

    Joined:
    Jan 31, 2009
    Messages:
    408
    Likes Received:
    0
    Device:
    iPhone 5 (Black)
    umm.. a little idea... but not in the BATCH language...

    answer = user's choise

    BLOCK "A"
    if (answer == "x")
    {
    --Do stuff for X
    GO TO BlOCK "B"
    }
    else if (answer == "v")
    {
    --Do stuff for V
    GO TO BlOCK "B"
    }
    else if (answer == "z")
    {
    --DO stuff for Z
    GO TO BlOCK "B"
    }
    else
    {
    Message "Sorry, Incorrect Selection"
    GO TO BlOCK "A"
    }

    BLOCK "B" (The future code... after the selection)
  3. DarkWrath

    DarkWrath Active Member

    Joined:
    Apr 17, 2009
    Messages:
    1,218
    Likes Received:
    0
    Device:
    4G iPod touch
    Sorry, I was looking for an example that I could try out in a batch file. One actually written correctly for a batch file so I can see what's going on.
  4. Antonpup

    Antonpup Member

    Joined:
    Jan 31, 2009
    Messages:
    408
    Likes Received:
    0
    Device:
    iPhone 5 (Black)
    that was just an idea...
  5. DarkWrath

    DarkWrath Active Member

    Joined:
    Apr 17, 2009
    Messages:
    1,218
    Likes Received:
    0
    Device:
    4G iPod touch
    Any other help/suggestions?

Share This Page