Normal Topic Manipulating a 2D Array (Read 697 times)
Blair Wettlaufer
Junior Member
Members
**
Offline


No personal text

Posts: 98
Location: Hamilton, ON
Joined: Jun 4th, 2005
Manipulating a 2D Array
Jul 27th, 2005 at 3:20pm
Print Post Print Post  
Hi all!

Next little question.  I have a two dimensional array that looks like this:

D;6;1501;2;1795;Bob
D;6;1502;2;1795;Fred
D;6;1502;2;1795;Mary
D;6;1502;2;1800;Llama
D;6;1502;2;1795;Esther

1) How can I change an element "vertically" in the array, such as changing all the D elements to F?

2) How can I put quotes and commas around the elements to be a delimited file?  Setstringarrayseparator will let me change ; to ",", but it won't encapsulate the first and last elements of each line with starting and ending quotes

Thanks!
  

Coesper erat: tunc lubriciles altravia circum&&Urgebant gyros gimbiculosque tophi:&&Moestenui visae borogovides ire meatu:&&Et profugi gemitus exgrabuere rathae
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Manipulating a 2D Array
Reply #1 - Jul 27th, 2005 at 3:35pm
Print Post Print Post  
Blair,

Do you actually have a formal array declared (something like - var vVals as Array[10, 5] of String)? If not, what exactly do you have?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Blair Wettlaufer
Junior Member
Members
**
Offline


No personal text

Posts: 98
Location: Hamilton, ON
Joined: Jun 4th, 2005
Re: Manipulating a 2D Array
Reply #2 - Jul 27th, 2005 at 3:43pm
Print Post Print Post  
No, I havent delcared an array[4,6], it's just a string.

The columns are a fixed number [6 in my example, 11 in what I'm programming] but the rows or number of records are an unknown and changing variable.

  

Coesper erat: tunc lubriciles altravia circum&&Urgebant gyros gimbiculosque tophi:&&Moestenui visae borogovides ire meatu:&&Et profugi gemitus exgrabuere rathae
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Manipulating a 2D Array
Reply #3 - Jul 27th, 2005 at 3:45pm
Print Post Print Post  
I need to know how you are assembling the "records" to tell you how to change a value in each one. Can you post the portion of your code that puts these StringArrays together?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged