|
| ReDim Preserve Fra : kimhald | Vist : 155 gange 50 point Dato : 05-10-06 20:40 |
|
Hej!
er der nogen der kan hjælpe mig dette problem
når jeg forsøger at udvide array får jeg run time error 9
subscript out of range
her er en lille testkørsel
Option Explicit
Option Base 1
Private Sub test()
Dim tmp() As Integer
ReDim tmp(1 To 1, 1 To 4)
ReDim Preserve tmp(1 To UBound(tmp) + 1, 1 To 4)
'code
ReDim Preserve tmp(1 To UBound(tmp) + 1, 1 To 4)
End Sub
mvh. Kim Hald
| |
|
Sakset fra hjælp
If you use the Preserve keyword, you can resize only the last array dimension and you can't change the number of dimensions at all. For example, if your array has only one dimension, you can resize that dimension because it is the last and only dimension. However, if your array has two or more dimensions, you can change the size of only the last dimension and still preserve the contents of the array. The following example shows how you can increase the size of the last dimension of a dynamic array without erasing any existing data contained in the array.
Du har altså kun mulighed for at ændre på den sidste parameter.
/Michael Christoffersen
| |
| Du har følgende muligheder | |
|
Dette spørgsmål er blevet annulleret, det er derfor ikke muligt for at tilføje flere kommentarer.
| |
|
|