Function parameter that can be either one device or an array of them?
I'm trying to write a function that I can call with either one dev or a dev array. I have some repetitive code that performs the same actions, but sometimes against a single device and sometimes against a device array. I'd like to be able to replace e.g.
on[dvTP_A,1]; send_command dvTP_A,"'^TXT',..."; ... on[dvAllTPs,1]; send_command dvAllTPs,"'^TXT',...";
The body of the function only passes the parameter in question to built-ins like
send_command, etc, and these can all take both
dev as the first argument, so I need a data type that can hold either.