String Array Constant Addition 
Author Message
 String Array Constant Addition

Is there an elegant way of marking the last element in a string array
constant? i.e. I take an Array constant, and add a simple string to it,
so that it becomes a String Array Constant. Now I add elements 1 and 2
and 3. But now I want to take element 3 out. If I just delete Element 3
contents from the string control, that is fine, but the # of Array
elements is still 3. It is just that the 3rd elelment is null. How can I
make the array length 2? Now I know that starting over is one option
(just creat a new array constant, and add the two elements) but what if
my array constant has 100 elements and I want to make it 99. I also
know that programatically I can remove these elelents, but I am taking
about in the programming of this constant. I must be over looking
something... Any ideas???

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Fri, 31 Jan 2003 03:00:00 GMT  
 String Array Constant Addition

Quote:

> Is there an elegant way of marking the last element in a string array
> constant? i.e. I take an Array constant, and add a simple string to it,
> so that it becomes a String Array Constant

Arrays must be all the same type. If the last element is a constant, all
elements are

Quote:
> Now I add elements 1 and 2
> and 3. But now I want to take element 3 out. If I just delete Element 3
> contents from the string control, that is fine, but the # of Array
> elements is still 3. It is just that the 3rd elelment is null.

In a string, yes, Empty strings are essentially nulls.

Quote:
> How can I
> make the array length 2? Now I know that starting over is one option
> (just creat a new array constant, and add the two elements) but what if
> my array constant has 100 elements and I want to make it 99. I also
> know that programatically I can remove these elelents, but I am taking
> about in the programming of this constant. I must be over looking
> something... Any ideas???

This is one of my problems. It is easy to size an array up, but hard to size
down.
Of course you can resize at run time but the only way I know to do this
when editing is to start over.

Kevin Kent

  Kevin.Kent.vcf
< 1K Download


Fri, 31 Jan 2003 03:00:00 GMT  
 String Array Constant Addition

Quote:
> This is one of my problems. It is easy to size an array up, but hard to
size
> down.
> Of course you can resize at run time but the only way I know to do this
> when editing is to start over.

What I've started doing is using multiline string controls with scrollbars
instead of arrays, then reading the individual lines into an array at
runtime- these problems are bad enough, but try adding or deleting elements
from the middle of a large array and it's truly gruesome. :)


Fri, 31 Jan 2003 03:00:00 GMT  
 String Array Constant Addition
hi,

To delete the last element of your array.  Use the "Array Subset"
function.  Wire the "array index" to 0 and "array length" to
(CURRENT_LENGTH - 1).

eric


Quote:

> Is there an elegant way of marking the last element in a string array
> constant? i.e. I take an Array constant, and add a simple string to
it,
> so that it becomes a String Array Constant. Now I add elements 1 and 2
> and 3. But now I want to take element 3 out. If I just delete Element
3
> contents from the string control, that is fine, but the # of Array
> elements is still 3. It is just that the 3rd elelment is null. How
can I
> make the array length 2? Now I know that starting over is one option
> (just creat a new array constant, and add the two elements) but what
if
> my array constant has 100 elements and I want to make it 99. I also
> know that programatically I can remove these elelents, but I am taking
> about in the programming of this constant. I must be over looking
> something... Any ideas???

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Fri, 31 Jan 2003 03:00:00 GMT  
 String Array Constant Addition
Sorry, I didn't fully underderstand what you were trying to do.  Unless
you do this task programmatically, I don't think that this is possible.



Quote:
> hi,

> To delete the last element of your array.  Use the "Array Subset"
> function.  Wire the "array index" to 0 and "array length" to
> (CURRENT_LENGTH - 1).

> eric



> > Is there an elegant way of marking the last element in a string
array
> > constant? i.e. I take an Array constant, and add a simple string to
> it,
> > so that it becomes a String Array Constant. Now I add elements 1
and 2
> > and 3. But now I want to take element 3 out. If I just delete
Element
> 3
> > contents from the string control, that is fine, but the # of Array
> > elements is still 3. It is just that the 3rd elelment is null. How
> can I
> > make the array length 2? Now I know that starting over is one option
> > (just creat a new array constant, and add the two elements) but what
> if
> > my array constant has 100 elements and I want to make it 99. I also
> > know that programatically I can remove these elelents, but I am
taking
> > about in the programming of this constant. I must be over looking
> > something... Any ideas???

> > Sent via Deja.com http://www.deja.com/
> > Before you buy.

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Fri, 31 Jan 2003 03:00:00 GMT  
 String Array Constant Addition

Quote:
> Is there an elegant way of marking the last element in a string array
> constant? i.e. I take an Array constant, and add a simple string to it,
> so that it becomes a String Array Constant. Now I add elements 1 and 2
> and 3. But now I want to take element 3 out. If I just delete Element 3
> contents from the string control, that is fine, but the # of Array
> elements is still 3. It is just that the 3rd elelment is null. How can I
> make the array length 2? Now I know that starting over is one option
> (just creat a new array constant, and add the two elements) but what if
> my array constant has 100 elements and I want to make it 99. I also
> know that programatically I can remove these elelents, but I am taking
> about in the programming of this constant. I must be over looking
> something... Any ideas???

It is possible to do this to the control, but not elegant or easy.  It will
take about six or so clicks.  The good news is that the next version of LV
allows you to click on the element in the array, popup, and under Data
Operations, Choose Delete Element or Insert Element.  The same thing
works for rows and columns on 2D arrays.

Greg McKaskle



Sat, 01 Feb 2003 09:43:09 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Array Of Constant Strings?

2. constant string array

3. Array to String and String to Array

4. overloading array addition within f90 type?

5. % substitution vs string addition?

6. Scan (+Binary Scan) to Array feature addition?

7. Scan (+Binary Scan) to Array feature addition?

8. Convert 1D string Array to Numeric Array

9. convert a string array to a 2-d array

10. Adding strings manually to an array of strings

11. equivalencing a charactor string array to a double array

12. Defining string constant with ASCII Code Under 32

 

 
Powered by phpBB® Forum Software