IF THEN vs Switch

Last night I used this trick on an old macro, using the assigned key in parenthesis :wink:
This is a great trick. Thanks!

2 Likes

I was checking the wiki page. I can see how using just / or /. is assigned to Enter/Return or Escape. Thanks

1 Like

Glad to help! It is great being able to assign buttons to keys. :grin:

1 Like

Do you mind sharing the 2 versions so I can see what you mean?

Yes, I can see how having Switch instead of IF THEN looks better and cleaner, especially when it comes to nesting IF THEN actions, which is kinda messy

1 Like

I think the wiki page explains this

The actions in the first section that matches will be executed. If no section matches, then no actions will be executed and the execution will continue after the Switch/Case action. Under no circumstances will actions from more than one section be executed - that is, execution does not “fall through” to following sections as happens in some languages.

So basically, once there's a match (reading top to bottom), it leaves the Switch action and goes to the next action.

1 Like

Thank you all for sharing your approaches to Switch vs If Then.
Always learning a few tricks here and there :wink:

1 Like