Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP IN LOADING ARRAY

Status
Not open for further replies.

99Chuck99

Programmer
Dec 11, 2003
67
US
Can anybody help with loading this array. I can get ARR(i) to work but not ARR(i,j)


this works:
for i = 0 to 1
for t = 0 to 12
arr(i,j) = bandHTML.children("rev").value
next
next

this doesn't
for i = 0 to 1
for t = 0 to 12
arr(i,j) = bandHTML.children("rev").value ,OTHER VALUE
next
next

Thanks in advance.
 




Hi

How about something like this...
Code:
  for t = 0 to 12    
    arr(0,j) = bandHTML.children("rev").value 
    arr(1,j) = someothervalue
  next

Skip,

[glasses] [red][/red]
[tongue]
 
My final goal is to load the muli dimen array as a rng to Excel. Does the example you post still keep my array a dimentioned, I guess that the 0 is a holder. Does that sound correct. Thanks for the quick reply.
 



My question to you is, how does bandHTML.children("rev").value change as j incriments?

What is the source of the data that you are loading into the array?

Skip,

[glasses] [red][/red]
[tongue]
 
Skip,
You proablly don't want to here this but is on Data Access Page. All is working well except when I try to load the multi dimentioned array. Both i and j get incremented through a loop of the expand band in my DAP. The snippet below is where I started the Array but this example does not allow muti fields to be added.
 
Sorry did add the code
for i = 1 to 20
for j = 1 to 10
arr(i-1,j-1) = i*j (this is where i need to add one set of a for i and another set fo j)
next
next
 



You are NOT adding MULTIPLE fields/values.

Its one at a time

first pass thru the loop,
i=1, j=1 -- that array element gets one value
then
i=1, j=2 -- that array element gets one value
.....

So what KIND of data goes in the i place and what KIND of data goes in the j place?

Skip,

[glasses] [red][/red]
[tongue]
 
Skip,
My goal for this project to be able to export from a Data Access Page to Excel. It is so close to working.I have seen many request on how to do this but no answers. I have it set up to only export the data within the expanded band. When I get this working I will post the entire code for others to use.
chuck
 
Skip,
I'm posting the code that I got the idea from. If you paste into word and hit run a pic is worth a thousand words.

First element in array in "DocNo"
Then I was going to and all the other data associated to the book in second element. Trying to setup RNG as in this example.

<BODY>

<INPUT id=button1 name=button1 type=button value=Button>

<SCRIPT LANGUAGE="VBScript">

sub button1_onclick()

' Launch Excel
dim app
set app = createobject("Excel.Application")

' Make it visible
app.Visible = true

' Add a new workbook
dim wb
set wb = app.workbooks.add

' Fill array of values first...
dim arr(19,9) ' Note: VBScript is zero-based
for i = 1 to 20
for j = 1 to 10
arr(i-1,j-1) = i*j
next
next

' Declare a range object to hold our data
dim rng
set rng = wb.Activesheet.Range("A1").Resize(20,10)

' Now assign them all in one shot...
rng.value = arr

' Add a new chart based on the data
wb.Charts.Add
wb.ActiveChart.ChartType = 70 'xl3dPieExploded
wb.ActiveChart.SetSourceData rng, 2 ' xlColumns
wb.ActiveChart.Location 2, "Sheet1" 'xlLocationAsObject

' Rotate it around...
for i = 1 to 360 step 30
wb.activechart.rotation = i
next

' Give the user control of Excel
app.UserControl = true

end sub
</SCRIPT>

</BODY>
</HTML>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top