I see no reason for an error message in the single line above, but can you post a small script that shows a problem with such a macro? I'll check it.

You should however never declare something within a macro. This can become very messy. Use a global declaration.