Jump to content
Macro Express Forums

Multiple Choice Menu


ocillmusic

Recommended Posts

If I understnad you correct it would look like this in the scripting editor:

 

Multiple Choice Menu: Open a folder
If Variable %T1% = "A"
 Open Folder: c:\blue
End If
If Variable %T1% = "B"
 Open Folder: c:\red
End If
If Variable %T1% = "C"
 Open Folder: c:\green
End If

 

To see what's really going on copy and paste this part into the scripting editor.

 

<MENU2:2:T:01:CenterCenter:Open a folderBlue
Red
Green><IFVAR2:1:01:1:A><MYCOMP:c:\blue><ENDIF><IFVAR2:1:01:1:B><MYCOMP:c:\red><ENDIF><IFVAR2:1:01:1:C><MYCOMP:c:\green><ENDIF>

Link to comment
Share on other sites

It looks correct. Another option is to use the Switch/End Switch construct.

 

Multiple Choice Menu: Open a folder
Switch (T1)
 Case: A
   Open Folder: c:\blue
 End Case
 Case: B
   Open Folder: c:\red
 End Case
 Case: C
   Open Folder: c:\green
 End Case
End Switch

----------
<MENU2:2:T:01:CenterCenter:Open a folderBlue
Red
Green><SWITCH:T1><CASE:A><MYCOMP:c:\blue><ENDCASE><CASE:B><MYCOMP:c:\red><ENDCASE><CASE:C><MYCOMP:c:\green><ENDCASE><ENDSWITCH>

Link to comment
Share on other sites

In cases like these I don’t see the benefit of the Case command. Unless you have multiple nested conditions it just adds two extra lines. Of course it’s possible I am ignorant to some other benefit to using case in which case I would love to be enlightened. Lord knows I have a lot to learn.

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