March 6, 20178 yr Is it better to have 1 long script with 5 different if statements or 5 different scripts? (the 5 scripts would be assigned to 5 different buttons, the long script would be assigned to every single button)
March 6, 20178 yr Some more details would be useful, esp. regarding the condition that the 5 If statements are supposed to enforce. I suspect a single script could be written without requiring multiple Ifs. In any case, the difference in performance will be most likely negligible.
March 6, 20178 yr Author The purpose of the if statement is to see on what layout the user is in. Based on the layout then I do an export of the data found on said layout. I can do this with 5 different scripts or one long script, which way would you prefer? or maybe not necessarily with an if statement?
March 6, 20178 yr How different is the export process for each layout? In other words, how much of the single-long-script version would live inside the If...Else If...Else branches vs. how much would be the same steps (configured the same way) running outside the If[] block? The more steps in common, the more sense it makes to have the one long script. The more different steps there are, the more it makes sense to have separate smaller scripts. There's also another option for how to break up the logic which might be worth considering: one script for each layout, and each of those scripts calls common sub-scripts for substantial chunks of steps that are exactly the same. I lean towards this approach when there are both large chunks of logic different between contexts, AND large chunks of logic in common.
Create an account or sign in to comment