|
-
Jul 9th, 2007, 10:26 AM
#1
Thread Starter
Lively Member
XML from 2 dimention array
Hi I have a two dementioned array ie myArray(10,10).
How can I create XML quickly from the values in this array without looping round the array?
Thanks
Paul
-
Jul 9th, 2007, 11:56 AM
#2
Re: XML from 2 dimention array
-
Jul 9th, 2007, 12:08 PM
#3
Re: XML from 2 dimention array
In other words, even if there is a function that does this, internally, it's still using loops...
This type of question is asked a lot latelly.... that the anser is obvious... if there is something with many items... it means you need a loop.
-
Jul 9th, 2007, 12:39 PM
#4
Addicted Member
Re: XML from 2 dimention array
you can create a CSV file, which can be opened by excel
Code:
Open "myfile.csv" For Output As #1
For i = 0 To UBound(the_array)
Print #1, the_array(i, 0), ",", the_array(i, 1), ",", the_array(i, 2), ",", the_array(i, 3), ",", the_array(i, 4), ",", the_array(i, 5), ",", the_array(i, 6), ",", the_array(i, 7), ",", the_array(i, 8), ",", the_array(i, 9)
Next i
Close #1
each Print statement prints a new line in the file
-
Jul 9th, 2007, 01:04 PM
#5
Re: XML from 2 dimention array
 Originally Posted by unxzst
you can create a CSV file, which can be opened by excel
Code:
Open "myfile.csv" For Output As #1
For i = 0 To UBound(the_array)
Print #1, the_array(i, 0), ",", the_array(i, 1), ",", the_array(i, 2), ",", the_array(i, 3), ",", the_array(i, 4), ",", the_array(i, 5), ",", the_array(i, 6), ",", the_array(i, 7), ",", the_array(i, 8), ",", the_array(i, 9)
Next i
Close #1
each Print statement prints a new line in the file
Of course there are many ways to do what he wants but he stated "without looping round the array".
-
Jul 9th, 2007, 01:08 PM
#6
Addicted Member
Re: XML from 2 dimention array
 Originally Posted by MartinLiss
Of course there are many ways to do what he wants but he stated "without looping round the array".
oh LOL you're right, i should pay more attention.
let me know if you guys find a way
-
Jul 9th, 2007, 01:46 PM
#7
Re: XML from 2 dimention array
You could write out the area of memory the array resides in but a) it's really still looping around the array, just in a different way and b) the resultant file would probably need some heavy coding to read.
You CAN scratch your left elbow with your left hand, but the medical bills, pain and recovery time for a broken arm make scratching it with your right hand much more sensible.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Jul 10th, 2007, 10:59 AM
#8
Thread Starter
Lively Member
Re: XML from 2 dimention array
Ok thanks for your help anyway.
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
|