From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Concating many strings at more efficient way

Solved!
Go to solution

Hello,

 

I am using a code that concating many different strings and data, but it looks very messy.

Is there a better efficient way to do it?

This is an example for a part where I have to connect all the data:

strings.jpg

Thanks

 

0 Kudos
Message 1 of 4
(2,614 Views)

The picture is too small to really tell what is going on, but it looks like you have a lot of constants being concatenated together.

 

When you have a lot of constants, it would be easier to combine them into a single constant.  When you have several strings interspersed by a lot of constants, then you should use Format Into String.  But the constants into the Format string and use multiple %s placeholders for all the variable values you have coming in.  That let's you reduce all the wiring down to a a single function node.

Message 2 of 4
(2,587 Views)
Solution
Accepted by topic author ShakRatz

@RavensFan wrote:

When you have several strings interspersed by a lot of constants, then you should use Format Into String.  But the constants into the Format string and use multiple %s placeholders for all the variable values you have coming in.  That let's you reduce all the wiring down to a a single function node.


Here's what RavensFan means:

Format String.PNG

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 3 of 4
(2,564 Views)

Hey RavensFan and James

Thanks a lot, that's exactly what I  was looking for. 

Shak

0 Kudos
Message 4 of 4
(2,553 Views)