Trying to learn how to use an array. (got question

# Thread: Trying to learn how to use an array. (got question

1. Senior Member
Join Date
Dec 1969
Posts
217

## Trying to learn how to use an array. (got question

&#060;%&#039; <BR>&#039;Hi i&#039;m trying to learn how to use an array. Especially to redim it<BR>&#039;However i&#039;m getting the following error when i try to redim it<BR> <BR>&#039;This array is fixed or temporarily locked<BR>&#039;/evals/test.asp, line 10<BR> <BR> &#039;what am i doing wrong<BR><BR><BR> Dim strUsedEmp(4)<BR><BR> strUsedEmp(0) = "one" <BR> strUsedEmp(1) = "two"<BR> strUsedEmp(2) = "three"<BR> strUsedEmp(3) = "four"<BR><BR> redim Preserve strUsedEmp(4)<BR> strUsedEmp(4) = "five"<BR> <BR>%&#062;<BR><BR>&#060;% for intCounter = 0 to 7 %&#062;<BR>&#060;%= strUsedEmp(intCounter) %&#062; <BR><BR>&#060;% next <BR><BR><BR><BR>%&#062;

2. Senior Member
Join Date
Dec 1969
Posts
11,334

## RE: Trying to learn how to use an array. (got ques

I think when you make it non-dynamic, you can&#039;t change it later... try<BR><BR>Dim strUsedEmp() &#039;variable size<BR>ReDim strUsedEmp(4)<BR><BR>strUsedEmp(0) = "one" <BR>strUsedEmp(1) = "two"<BR>strUsedEmp(2) = "three"<BR>strUsedEmp(3) = "four"<BR><BR>redim Preserve strUsedEmp(4)<BR>strUsedEmp(4) = "five"<BR>

3. Senior Member
Join Date
Dec 1969
Posts
217