|
-
Nov 3rd, 2006, 08:10 AM
#1
Thread Starter
Member
[RESOLVED] simple copying of information from 1D array of arrays to 2D array
Hi everyone, is there any reason that in this case intermediateArray will contain nothing when I've checked that tempArray does contain information. Both are declared as strings, and both are the same length.. The code is inside two loops to go through counter and counter2.
VB Code:
intermediateArray(counter, counter2) = tempArray(counter)(counter2)
-
Nov 3rd, 2006, 08:16 AM
#2
Hyperactive Member
Re: simple copying of information from 1D array of arrays to 2D array
then only reason to contain nothing is that temparray(counter)(counter2) is nothing
-
Nov 3rd, 2006, 09:32 AM
#3
Thread Starter
Member
Re: simple copying of information from 1D array of arrays to 2D array
that's exactly what I thought. I've just checked it again and still every entry reads as nothing. I deliberately put an error right after it so that when debugging I could look back and find out the contents of each array and compare them. the full loop code is:
VB Code:
Dim intermediateArray(0 To 5, 0 To 5) As String
ReDim intermediateArray((y - 1), x)
For counter = 0 To (y - 1)
For counter2 = 0 To (x)
intermediateArray(counter, counter2) = tempArray(counter)(counter2)
Next
Next
Testing the values right after this loop gives the values of tempArray as they are supposed to be (not nothing) and the values of intermediateArray as nothing for each entry.
tempArray contains { {1,2,3,4,""}, {1,2,3,4,""} etc. }
intermediatearray contains {nothing,nothing, etc.}
Can you suggest anyway that I can attempt to debug it. What kind of thing I should be looking for in the code etc.
Thanks
Andy
-
Nov 3rd, 2006, 10:26 AM
#4
Thread Starter
Member
Re: simple copying of information from 1D array of arrays to 2D array
Problem solved, I'm being an idiot!
-
Nov 3rd, 2006, 10:51 AM
#5
Hyperactive Member
Re: [RESOLVED] simple copying of information from 1D array of arrays to 2D array
To many time looking for witches and elfs in your program
-
Nov 3rd, 2006, 10:55 AM
#6
PowerPoster
Re: [RESOLVED] simple copying of information from 1D array of arrays to 2D array
was it..
intermediateArray(counter, counter2) = tempArray(counter, counter2)
-
Nov 3rd, 2006, 11:08 AM
#7
Thread Starter
Member
Re: [RESOLVED] simple copying of information from 1D array of arrays to 2D array
not quite, pasvorto - it was the debugging info that I was misreading...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|