Jump to content
Macro Express Forums

Repeat Multiple Choice Menus (--> next ; <-- previous)


MacroPolo

Recommended Posts

I've searched everywhere for a solution to this, and cannot seem to find one.

 

Here is what I am trying to accomplish:

 

There is too much data to fit in a single multiple choice menu. (In fact, the menu items fill 4 menus). I saw the recent solution adding a (more) option. However, I need to take this one step further, on the menu's I would like a "--> next" option to go to the next menu. I would also like a "<-- previous" option as well.

 

Since there is no "goto" command, I tried experimenting with the repeat command without any luck. Using repeat, I can scroll forward through the menus, but I can't seem to get back to the prior menus.

 

Below is my current macro. All the Multiple Choice Menu's have the destination variable of %T1%. When %T1% contains some value, the repeat ends. I included %N1% to differentiate the Menu # (ie: Menu 1; Menu 2; Menu 3; Menu 4).

 

Variable Set Integer %N1% to 1
Variable Set String %T1% ""
Repeat Until %T4% <> ""

 Switch (N1)

    Case: 1
         Multiple Choice Menu: 1   [destination variable = %T1%]
         If Variable %T1% = "  next -->"
              Variable Set Integer %N1% to 2
         End If
         If Variable %T1% = " prev <--"
              // no prior menu; do nothing
         End If
    End Case

    Case: 2
         Multiple Choice Menu: 1   [destination variable = %T1%]
         If Variable %T1% = "  next -->"
              Variable Set Integer %N1% to 3
         End If
         If Variable %T1% = " prev <--"
              Variable Set Integer %N1% to 1
         End If
    End Case

    Case: 3
         Multiple Choice Menu: 1   [destination variable = %T1%]
         If Variable %T1% = "  next -->"
              Variable Set Integer %N1% to 4
         End If
         If Variable %T1% = " prev <--"
              Variable Set Integer %N1% to 2
         End If
    End Case

    Case: 4
         Multiple Choice Menu: 1   [destination variable = %T1%]
         If Variable %T1% = "  next -->"
              // no further menu's; do nothing
         End If
         If Variable %T1% = " prev <--"
              Variable Set Integer %N1% to 3
         End If
    End Case
 End Switch
Repeat End

 

 

Any ideas how to get the repeat to recognize the " prev <--" ?

 

Thanks!

Steve

Link to comment
Share on other sites

This is a simple way...in addition to the MORE selection, also have a PREVIOUS selection on menu 2, 3 and 4. Put a IF statement with a repeat in it and it will start back at the top (menu 1). You could put additional IF's in for specific menu's, but that would mean using (wasting) more selections. I've used the above to go back to the first then quickly choose the More till I get to the one I wanted.

 

Good Luck!

Link to comment
Share on other sites

This is a simple way...in addition to the MORE selection, also have a PREVIOUS selection on menu 2, 3 and 4. Put a IF statement with a repeat in it and it will start back at the top (menu 1). You could put additional IF's in for specific menu's, but that would mean using (wasting) more selections. I've used the above to go back to the first then quickly choose the More till I get to the one I wanted.

 

Good Luck!

 

Could you provide a sample code to accomplish this? Would love a working example of a MORE and PREVIOUS menu selection.

 

Thank you!

Link to comment
Share on other sites

Johnboy691... Thank you! Thank you!! Thank you!!! In my 75 minute drive home, I put some thought into what you said. And after my drive home, I had a few drinks. In a matter of minutes, I came up with this working solution:

 

 


Variable Set Integer %N2% to 1
// used to initialize the Switch(N2) command

Variable Set Integer %N1% to 500
// set this integer rediculously high

Repeat with Variable using %N1%
Switch (N2)
	Case: 1
		Multiple Choice Menu: 1
		If Variable %T1% = "--> Next"
			Variable Set Integer %N2 to 2
		Else
			Break
		End If
	End Case

	Case: 2
		Multiple Choice Menu: 2
		If Variable %T1% = "--> Next"
			Variable Set Integer %N2 to 3
		Else
			If Variable %T1% = "<-- Back"
				Variable Set Integer %N2% to 1
			Else
				Break
			End If
		End IF
	End Case

	Case: 3
		Multiple Choice Menu: 3
		If Variable %T1% = "--> Next"
			Variable Set Integer %N2 to 4
		Else
			If Variable %T1% = "<-- Back"
				Variable Set Integer %N2% to 2
			Else
				Break
			End If
		End IF
	End Case

	Case: 4
		Multiple Choice Menu: 4
		If Variable %T1% = "--> Next"
			Variable Set Integer %N2 to 3
		Else
			If Variable %T1% = "<-- Back"
				Variable Set Integer %N2% to 3
			Else
				Break
			End If
		End IF
	End Case
End Switch
Repeat End
Text Box Display:  You selected %T1%

 

I could kick myself for spending HOURS on this earlier today, when it only took a few minutes to type out.

If I could figure out how to paste the MEX code in here without messing the code up, I'd do it.

Anyways, there you have it. It works good enough for my needs. Thanks again!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...