09-27-2008 07:57 AM
Dear All,
Can any one pls tell me how to Create "2D array of 1D array of String"?
I think i need to create a Cluster of 1D array of String and then put that Cluster in a 2D array.
But i am not getting how to insert values to it.
Thanks,
Ritesh
09-27-2008 08:10 AM
I am not sure that I fully understand your question, but your solution does not sound like a good idea.
Two functions jump to mind:
* Reshape array will allow you to change a 1D array into a 2 D array (example: 6-element 1-D into a 2x3 2-D)
* Build Array will turn the 1D array into a 2D (example: (6-element 1-D into a 1x6 2-D)
09-27-2008 08:20 AM
Dear 10things,
I think you didn't get my question.
The Solution you suggestd will change the Dimension of the Array.
I dont want to reshape or convert 2d to 1D.
I want to have 2D array of 1D array of String.
In C/C++, i do it like:
Create a 2D array of Structure. and the Structure consists of 1D array of char String.
I hope you get it right this time.
Thanks,
Ritesh
09-27-2008 10:11 AM
09-27-2008 01:39 PM
I did the same thing as you mentioned.
But, i am falling short in the block diagram panel. I am not getting how to write data to it .
Could u pls write a small example to show how to do it?
Thanks,
Ritesh
09-27-2008 01:59 PM - edited 09-27-2008 02:00 PM
Here's a quick draft. See if this helps.
(primitives are "index array", "replace array subset", "unbundle by name", "bundle by name".)
(A better way might be to use the "in place structure")
09-27-2008 02:02 PM
Well, that kind of depends on what part you're trying to write. Since you have a 2D array of clusters, and each cluster contains a 1D array of strings, you can either be writing an element of the 1D array of strings or one of the clusters. Attached is an example.
Was just about to post it when I got the notification of altenbach's message. Well, that should give you an idea of what to do.
09-27-2008 02:05 PM - edited 09-27-2008 02:06 PM
altenbach wrote:(A better way might be to use the "in place structure")
And here's an example for that:
This is not available in older LabVIEW versions.
09-29-2008 05:27 AM
Hi,
Thanks alot for your Help.
I hardly had any idea about "in place structure". This thing just works amazing.
But, just a bit of query left now.
If i dont initialize the Array, it doesn't put any value into it.
Is there a way that array allocates memory at runtime rather than initializing it with a magic number ?
Thanks,
Ritesh
09-29-2008 05:37 AM
And yes one more thing.
Is it advisable to use Local variables or shift registers ?
Which is more time efficient ?
Thanks,
Ritesh