LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build string array

Hello,

 

I am trying to build an array of string and number using the build array function e.g. {a, 1};{b, 2}. Unfortunately, I am having difficulty doing this as I am using Labview 7 which seems to only take decimal numbers.

 

Any information is much appreciated.

0 Kudos
Message 1 of 7
(6,838 Views)

Every element  in an array must be of the same type, so you cannot simply have numbers and strings intermingled. The data type that you put into an array shell is the only data type that is may contain.

 

Two things you could do are:

 

1) Convert the number to a string, and store an array of strings

 

2) Make a cluster containing a number and a string, and store an array of the cluster

 

Rod.

 

0 Kudos
Message 2 of 7
(6,830 Views)

eceone wrote:

Hello,

 

I am trying to build an array of string and number using the build array function e.g. {a, 1};{b, 2}. Unfortunately, I am having difficulty doing this as I am using Labview 7 which seems to only take decimal numbers.

 

Any information is much appreciated.


As was posted by Rod above, trying to mix and match is your problem.

 

However, just to clarify, just because it is an orange connector doesn't always mean it only takes doubles. Build array takes many different data types. Yes, even in version 7 😉

Message Edited by for(imstuck) on 10-27-2009 01:52 PM
0 Kudos
Message 3 of 7
(6,813 Views)

Hope this helps and gives you a starting point. The for loop creates an array of clusters. Then you can index the array to access individual clusters. Then unbundle those clusters to access the individual elements of that cluster

 

 

Message Edited by for(imstuck) on 10-27-2009 02:18 PM
0 Kudos
Message 4 of 7
(6,798 Views)

thank you. However, in version 7 build array does not seem to take strings as inputs. Please let me know if i'm wrong.

 

thanks.

0 Kudos
Message 5 of 7
(6,783 Views)
You are wrong. Build array has always taken strings as inputs. It takes all data types as inputs.
Message 6 of 7
(6,779 Views)

Dennis Knutson wrote:
You are wrong. Build array has always taken strings as inputs. It takes all data types as inputs.

Lol Dennis. Blunt mode = On

 

I guess he did ask if he was wrong 🙂

 

And OP, now would be the time to post a screenshot or the code so people can tell you what you're doing wrong.

 

Message Edited by for(imstuck) on 10-27-2009 03:38 PM
0 Kudos
Message 7 of 7
(6,771 Views)