直播中
以下舉例說明不恰當(dāng)?shù)氖褂胷edim
<%
dim MyArray()
Redim MyArrray(2)
MyArray(0) = "hello"
MyArray(1) = "good-bye"
.
.
.
some other code where you end up needing
more space happens then ...
Redim Preserve MyArray(5)
MyArray(2) = "more stuff"
MyArray(3) = "even more stuff"
MyArray(4) = "yet more stuff"
%>
其實(shí)在開始就定義myarray(5),而以后需要的話再用redim去增加他的大小,
這樣的話可能會占用一些內(nèi)存,但速度就要快得多了。