blimey Posted November 7, 2006 Report Share Posted November 7, 2006 Hi I am collecting input from a multiple choice menu the answers being say, A B C D. Correct entries can be A&C A&D B&C B&D, any other combinations are incorrect. The input is stored in a variable, and then in a series of nested if else statements the input is measured against 1 of the above. How do I make it so that any incorrect answers loop back to the original menu question? Ta for your help. Quote Link to comment Share on other sites More sharing options...
Strathos Posted November 7, 2006 Report Share Posted November 7, 2006 Hello blimey I think you have to use Switches and Cases. This is how I would do it: Repeat Until %T2% = "OK" Multiple Choice Menu: Choose! Text Box Display: Answer Switch (T1) // IF Correct Case: AC Variable Set String %T2% "OK" Text Box Display: Correct! End Case Case: AD Variable Set String %T2% "OK" Text Box Display: Correct! End Case Case: BC Variable Set String %T2% "OK" Text Box Display: Correct! End Case Case: BD Variable Set String %T2% "OK" Text Box Display: Correct! End Case // IF Wrong Default Case Text Box Display: Incorrect! End Case End Switch Repeat End Text Box Display: Finished <REP3:08:000001:000001:0002:0:01:OK><MENU2:2:F:01:CenterCenter:Choose!Correct Answers: AC AD BC BDA B C D><DIS:<TBOX4:T:1:CenterCenter000278000200:000:Answer%T1%><SWITCH:T1><REM2:IF Correct :)><CASE:AC><TVAR2:02:01:OK><TBOX4:T:1:CenterCenter000278000200:000:Correct!:D><ENDCASE><CASE:AD><TVAR2:02:01:OK><TBOX4:T:1:CenterCenter000278000200:000:Correct!:D><ENDCASE><CASE:BC><TVAR2:02:01:OK><TBOX4:T:1:CenterCenter000278000200:000:Correct!:D><ENDCASE><CASE:BD><TVAR2:02:01:OK><TBOX4:T:1:CenterCenter000278000200:000:Correct!:D><ENDCASE><REM2:IF Wrong><DEFCASE><TBOX4:T:1:CenterCenter000278000200:000:Incorrect!: (><ENDCASE><ENDSWITCH><ENDREP><TBOX4:T:1:CenterCenter000278000200:000:Finished> Quote Link to comment Share on other sites More sharing options...
blimey Posted November 8, 2006 Author Report Share Posted November 8, 2006 Hey! Lovely solution, just what I was looking for thanks for your help. Quote Link to comment Share on other sites More sharing options...
Strathos Posted November 8, 2006 Report Share Posted November 8, 2006 No problem! Glad I could help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.