Page 1 of 1

What is make a local copy of the value used for?

Posted: Mon Jul 25, 2022 6:18 pm
by Amtor
Hello,
What is make a local copy of the value used for.
A value still gets passed into the marco being called and appears as a local value even if the box is not checked.
I may be going senile.
Thanks.
Mark
local copy.JPG
local copy.JPG (33.89 KiB) Viewed 810 times

Re: What is make a local copy of the value used for?

Posted: Mon Jul 25, 2022 6:40 pm
by mnfisher
Strings can be passed by reference or value - reference just passes the address and any changes made are passed back.

Make a local copy does exactly that (so passed by value)- so any changes are kept local to the macro.

Note that the box is 'checked' but not selectable for arrays but these are all passed by reference.

Making a local copy is slower and should probably be avoided in most cases.

Martin

Re: What is make a local copy of the value used for?

Posted: Mon Jul 25, 2022 9:15 pm
by Amtor
Thanks very much.
I seem to remember something not quite working as I expected once, when I had that box checked but can't remember what now.

Anyway I'll leave it un-checked it's too advanced for me.

Good luck
Mark