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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Array 1

Status
Not open for further replies.

Gatorajc

MIS
Mar 1, 2002
423
US
Can anyone tell me how to create a dynamic array in asp.

I tried all these
Dim ProductIntakeCodeArray()
Dim ProductIntakeCodeArray(RecordCount)
Dim ProductIntakeCodeArray(UBound(ProductGroupCount,2))

but only this works

Dim ProductIntakeCodeArray(17)

Problem is I dont always know what the size is going to be. Any Ideas. Thanks

AJ
[americanflag]

Do you feel lucky?


 
Where are your values for RecordCount and ProductGroupCount coming from? Can we see the code?

If your recordset is opened with an incorrect cursortype then objRS.RecordCount will return -1 and therefore return an error when you try to declare your array with that value.

Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Dim can only accept absolute values.

Dim myArray(10).

You can use the 'ReDim' statment to change the size of the array once it is defined.

Dim myArray()
recordcount = 56
ReDim myArray(recordcount)

-----------------------
SnaveBelac - Adventurer
-----------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top