Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 26th, 2003, 08:21 AM
Registered User
 
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem of "Subscript out of range "

I have the the follwing ASP code for create Graph (use OWC object)

<%
' 2D array
Dim Vals(2,5)

Vals(0,0)=1
Vals(0,1)=2
Vals(0,2)=3
Vals(0,3)=4
Vals(0,4)=5

Vals(1,0)=10
Vals(1,1)=20
Vals(1,2)=30
Vals(1,3)=40
Vals(1,4)=50

' Create a Chart Object
Set oChart = CreateObject("OWC.Chart")
Set c = oChart.Constants

sCaption = "This is Graph "
oChart.Charts.Add
oChart.Charts(0).Type = oChart.Constants.chChartTypeColumnClustered


oChart.Charts(0).SeriesCollection.Add
oChart.Charts(0).SeriesCollection(0).Caption = sCaption
oChart.Charts(0).SeriesCollection(0).SetData c.chDimCategories, c.chDataLiteral, Categories
oChart.Charts(0).SeriesCollection(0).SetData c.chDimValues, c.chDataLiteral, Vals
%>

"Vals" is 2D array, I want to cteate Graph with 2 columns in each category (I have 5 categories). For Example: in the first category will be 2 columns, one with value 1 and seconed with value 10.
It's show me an ERROR of "Subscript out of range " on the line:

"oChart.Charts(0).SeriesCollection(0).SetData c.chDimValues, c.chDataLiteral, Vals"

Why? What's I did wrong?
What's the problem in my code? How to fix it??



 
Old November 26th, 2003, 08:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think VB arrays start from 1, right!?

Jacob.

 
Old November 26th, 2003, 10:45 AM
Registered User
 
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No. That's not the problem. Array start from 0.






Similar Threads
Thread Thread Starter Forum Replies Last Post
"Subscript out of range" in acFormPivotChart jilly Access VBA 0 April 23rd, 2008 08:52 PM
Array, Subscript out of range. koss77 VB How-To 4 August 21st, 2006 09:35 AM
Subscript out of range: '[number: 0]' jim_h Classic ASP Professional 0 February 24th, 2006 07:24 PM
Subscript out of range rfrancisco Classic ASP Components 1 February 13th, 2006 08:25 PM
Subscript out of range crmpicco Classic ASP Basics 4 March 22nd, 2005 06:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.