Yup, I was already sure but thanks for stating it anyway Marcus. Backwards compatibility is important because there's lots of old scripts out there that need to keep working i.e. upgrading to a newer version of Macro Scheduler should not cause them to break. And even beyond that, I really like having the option to use either... because each has advantages.mtettmar wrote:Look it's deprecated but there's no plans to remove the functionality and for backwards compat reasons (and look at our history) you can be pretty sure it will never be removed.
Bang on JRL... agreed. Your revelation that an in-line If when pointing to a subroutine acts like a GoSub surprised me... because I've always only used them to point at Labels... and have always only used a GoSub to make use of a subroutine. Just for fun, I wrote the following to prove it to myself...JRL wrote:The inline If method already jumps to subroutines, that is to say it already works as a GoSub>. That was the point of my previous post in this thread. And making it NOT work as a Goto> would be bad for backward compatibility.PepsiHog wrote:Maybe the inline IF could be redesigned to work as a Gosub, and not a Goto. That would be VERY convenient.
Code: Select all
Let>my_var=2
If>my_var=2,my_sub
MDL>you are below the IF statement now so the in-line if did act like a GoSub
Exit>0
SRT>my_sub
MDL>you are now in my_sub
END>my_sub
MDL>you are now below my_sub
I'll have to keep this in mind because it should let me cut down on the number of Labels required in some cases.
Also, I can see that if one were to use in-line Ifs to point to both Labels and Subroutines in a script, it becomes even more important to use distinctive subroutine names such as...
Code: Select all
SRT>DoUpdateUsageCounter
//Update the usage counter
...code
END>DoUpdateUsageCounter
- you're pointing at a subroutine
- if the subroutine finishes, execution will return to the line below
Speaking of "Best Practices"... the one thing that has helped me the most over the years is taking the time to use *meaningful* variable, subroutine and label names because then the code reads like a book and the logic is easy to follow. If you're new to Macro Scheduler, take this to heart and you'll find your code will be much easier to maintain.
Take care