Subroutine Default Parameter Value if *Nothing* Was Passed?

Is there an easy way to set a "default" parameter value for a subroutine if nothing was passed to it?

E.g. if the subroutine has a parameter for local__timesToRepeat...

If the calling Macro doesn't pass that parameter to the subroutine, I'd like the subroutine to act as if "2" was passed to it.

I know I can do this with an If statement to see if local__timesToRepeat is empty, but I'm just wondering if there's a more elegant way to do this.

I think not.

2 Likes

I agree with ccstone, that checking to see if that variable is empty or not is likely the best way.

3 Likes