|
| |
|
|
dzirkelb1
Posts: 1315 Joined: 10/5/2004 From: Cedar Rapids, Iowa Status: offline
|
Creating array with X as the size - 12/10/2007 15:33:24
I wish to create an array, but the size of the array will change everytime it is created. So, I need to know how to fix this code:
intHeaderCount = 0
for each strFieldHeader in rs.Fields
intHeaderCount = intHeaderCount + 1
response.write(strFieldHeader.Name&"<br>")
next
dim arrayFieldHeaders(intHeaderCount)
Error is: quote:
Microsoft VBScript compilation error '800a0402' Expected integer constant /LouisvilleForecast-update.asp, line 21 dim arrayFieldHeaders(intHeaderCount) What is the correct syntax for this?
|
|
|
|
ou812
Posts: 1603 Joined: 1/5/2002 From: San Diego Status: offline
|
RE: Creating array with X as the size - 12/10/2007 15:51:34
I think this might do it for you:
intHeaderCount = 0
dim arrayFieldHeaders()
for each strFieldHeader in rs.Fields
intHeaderCount = intHeaderCount + 1
response.write(strFieldHeader.Name&"<br>")
next
redim arrayFieldHeaders(intHeaderCount)
_____________________________
-brian EnterpriseDB: Enterprise-class relational database management system PostgreSQL: The world's most advanced open source database
|
|
|
|
dzirkelb1
Posts: 1315 Joined: 10/5/2004 From: Cedar Rapids, Iowa Status: offline
|
RE: Creating array with X as the size - 12/10/2007 15:59:26
Oh ya, redim, thats it...thanks!
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|