Jump to content

question about inputboxes


Recommended Posts

Is it possible to have multiple answers to a input box example: Q:what does 2+2=. A:4 OR A:6-2

Edited by Infinitex0

The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Link to comment
Share on other sites

  • Moderators

Something like this?

Dim $Question[3]
$Question[1] = InputBox("Question One", "What does 4+4 = ?" & @CRLF & @TAB & "A: 8" & @CRLF & @TAB &  "  Or" & @CRLF & @TAB &  "B: 9 - 2" _ 
& @CRLF & @CRLF & "Type the letter of the answer in the box.")
$Question[2] = InputBox("Question One", "What does 4+3 = ?" & @CRLF & @TAB & "A: 8" & @CRLF & @TAB &  "  Or" & @CRLF & @TAB &  "B: 9 - 2" _ 
& @CRLF & @CRLF & "Type the letter of the answer in the box.")

Dim $Answers[3]
$Answers[1] = 'A'
$Answers[2] = 'B'

Local $Check_Answers = 0
For $i = 1 To UBound($Question) - 1
    If StringInStr($Question[$i], $Answers[$i]) Then $Check_Answers = $Check_Answers + 1
Next

Local $Percentage = ($Check_Answers) / (UBound($Question) - 1) * (100)

MsgBox(48, 'Results', 'You scored a ' & $Percentage & '% on this test!')

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thanks

The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Link to comment
Share on other sites

  • Moderators

Thanks

Err... Good Deal... I don't even remember responding to this thread.. but glad it helped!

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • 2 months later...

LOL :think:

I was looking through my topics and D@/\/\N I didn't know crap. {sigh} good times.

The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...