A beginner question. Started with subroutines. What I want to do is add a local variable with a subroutine. The result should be "Initial macro text subroutine". See the macros below, but this does not work. What am I doing wrong?
subroutine.kmmacros (5.6 KB)
You've made two mistakes:
The first mistake is where you execute the subroutine. You must pass the value of the variable localmacro to the subroutine, not the name of the variable like this:
The next mistake is in your subroutine:
The value that you pass into your subroutine is stored in the variable localroutine but instead of using that variable for the rest of the subroutine, you use another variable called localmacro. So all that's coming out of the subroutine is the value you've assigned it in the subroutine, namely
" text subroutine".
To fix the problem change your subroutine so that you use "localroutine" throughout like this:
If you need further help, just ask!
1 Like