NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Why the + operator is not overloaded?

Hi,

 

Recently, I wanted to add two the same size arrays of numbers, but it looks like in TS the '+' operator is defined as overloaded.

 

Do someone know why?

 

K.

0 Kudos
Message 1 of 5
(3,870 Views)

I'm not sure what you mean. Please describe what you mean in more detail. Are you trying to add the elements from one array against the corresponding elements of the other array or are you trying to append the arrays to each other. If you want to add the elements from one array against the elements of another array, you will need to use looping options or one of the looping step types.

 

Hope this helps,

-Doug

0 Kudos
Message 2 of 5
(3,865 Views)

Yes, I'd like to the elements from one array against the elements of another array. And frankly speaking I was expecting the '+' operator to be overloaded and not to do looping to do the operation.

 

Does anyone know is the any reason why the '+' (and probably others operators ) are not overloaded?

0 Kudos
Message 3 of 5
(3,833 Views)

What you are expecting also does not work in C, C++, and C#. I am unaware of any text-based programming language that allows you to add the elements of an array like this.

 

However, feel free to suggest this on the Idea Exchange ( http://forums.ni.com/t5/NI-TestStand-Idea-Exchange/idb-p/teststandideas ) if you feel this would be a useful and important feature for TestStand to have.

 

If you need help with how to do the looping, please let us know.

 

Hope this helps,

-Doug

0 Kudos
Message 4 of 5
(3,815 Views)

No thanks, I'm OK with looping 🙂

 

I think the overloading could be usefull.

 

Cheers,

 

K.

0 Kudos
Message 5 of 5
(3,812 Views)