Can i change transforms in a list of robtargets?

I am trying to get rid of globals and typing names in my program.
I want to change transforms of some targets

CONST string targetnames{5}:=[“Target_R11_10”,“Target_R11_40”,“Target_R11_30”,“Target_R11_20”,“Target_R11_50”];

GetDataVal targetnames{1},current_robtarg1;! Is this a copy?
current_robtarg1.trans.z:=current_robtarg1.trans.z + z; ! will this change Target_R11_10?
Whats the best way to do it?

Are there global variables between tasks?

Also, anyway to reference tools and workobjects without names?
Thanks so much

Wait: CONST string targetnames are just names for lookup, the targets are PERS…, not writing to that array.

GetDataVal targetnames{1},current_robtarg1;! Is this a copy?

Is declared of course.

So is GetDataVala making a copy of my target implicitly? How do i reference a target without making a copy if it is?

I see, my oversight about just target names. No, it does not make a copy, per se, it writes the values from the target into the destination variable.

Great thanks

Hello,
GetDataVal copies the value of the data declaration into a variable.
If you modify the copied data, you have to use SetDataVal to write the new value back into the named data declaration.

/Br
Micky

Ah thanks so much, I check that