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

Declaring Variables in an Array

Status
Not open for further replies.

RussOSU

Technical User
Apr 16, 2001
93
US
I am new to VBScript and ASP. When I want to create an ASP page to collect data on student grades I declare the variables and then assign the variables a value as I did below.

Dim intStudentGrade1
Dim intStudentGrade2
Dim intStudentGrade3

intStudentGrade1 = 90
intStudentGrade2 = 100
intStudentGrade3 = 85

But do I have to declare the variables when creating an array to do this or do I just have to do:

Dim aintStudentGrade

aintStudentGrade(0) = 90
aintStudentGrade(1) = 100
aintStudentGrade(2) = 85
 
Dim aintStudentGrade
Redim aintStudentGrade(2) ' New dynamic
aintStudentGrade(0) = 90
aintStudentGrade(1) = 100
aintStudentGrade(2) = 85
......
Redim Preserve aintStudentGrade(2) ' Save Old dynamic, new size
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top