LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

append a constant string to every element in an array

Hi Friend,
I have a small stuck in my labview program that is I need to append a constant string to each element of an array. Could someone provide guidance on this? Prior thanks to your help.
 
Have a nice day!
 
Lee Joon
0 Kudos
Message 1 of 14
(7,171 Views)
There is probably an even faster way of doing this, but I couldnt find the function. So this will do what you want I think
 


Message Edited by jrpe on 11-15-2007 08:36 AM
Jeff


Using Labview 7 Express
Message 2 of 14
(7,163 Views)
Pass the array into a for loop with autoindexing; concatenate each element with the constant and then use the array output from the loop...





I was a few seconds behind the post above; great minds think alike!



Message Edited by Phillip Brooks on 11-15-2007 08:42 AM
Message 3 of 14
(7,159 Views)
haha I may have been faster, but I wasnt nearly as creative with my strings haha
Jeff


Using Labview 7 Express
0 Kudos
Message 4 of 14
(7,148 Views)
Hi Friends,
Thanks for the tremendous help! It's work very well and solve my problem in ease. Thank you very much. Have a wonderful evening!
 
Warmest Regards,
Lee Joon
0 Kudos
Message 5 of 14
(7,128 Views)

There is a better way to do it?

0 Kudos
Message 6 of 14
(961 Views)

Hi max,

 


@maxnoder1995 wrote:

There is a better way to do it?


"Better" in which way?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 14
(947 Views)

@maxnoder1995 wrote:

There is a better way to do it?


No, but a bunch of slightly to much worse versions. 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 14
(941 Views)

maxnoder1995_0-1732281224815.png

I can add 2 to each element of array without for loop.
why can't I append/prepend constant string to every element?

0 Kudos
Message 9 of 14
(937 Views)

@maxnoder1995 wrote:

maxnoder1995_0-1732281224815.png

I can add 2 to each element of array without for loop.
why can't I append/prepend constant string to every element?


Because Add primitive is polymorphic, and also contains "hidden" loop inside, but you don't see it. Just make your own SubVI for the strings, then you will get same "look and feel".

0 Kudos
Message 10 of 14
(929 Views)