Redim x[n] (要加上方括號) 只能用於 Crystal 語法中。
Crystal 語法中的 Redim 陳述式不能有多個陣列。
使用方式
Redim x[n]
X 陣列的維度重新調整成為 n 的尺寸,其中 x 是一組陣列,n 是指定新的大小為 n 所用的正整數。
範例
以下的例子適用於 Crystal 語法:
Local StringVar array x:= ["a", "bb", "ccc"];
// resize the array to size 4; old values are ignored
// and filled with default values of empty strings
Redim x [4];
x [4] := "dddd"; // only x[4] is initialized
註解
如果用 Redim 重新調整陣列的維度,陣列中的元素會填入那種型別的預設值,