|
-
Apr 23rd, 2003, 02:44 PM
#1
Thread Starter
New Member
'ReDim' cannot change the number of dimensions of an array.
THIS IS MY CODE AND IM HAVING UPDATE VB 6.0 VB .NET
'ReDim' cannot change the number of dimensions of an array.
HELP PLEASE WHAT'S MISSING
THANKS ALL
Private Sub cmdStart_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdStart.Click
Dim aryCount() As Integer
Dim HiCard As Integer
Dim Decks As Integer
Select Case MachineType
Case 12, 15, 17 : HiCard = 6 : Decks = 0 : Devices = 2 : CardLength = 1 'craps
Case Else : Err.Raise(vbObjectError + 1086, , "" & MachineType)
End Select
If Devices = 0 Then
ReDim aryCount(HiCard + 4)
Else
ReDim aryCount(HiCard, Devices) <<<<<<<THIS IS THE ARRAY IM having the problem with>>>>>>>>>>
End If
THIS IS THE ERROR: I GET
'ReDim' cannot change the number of dimensions of an array.
-
Apr 23rd, 2003, 02:56 PM
#2
Fanatic Member
Maybe it is:
ReDim aryCount(HiCard + 4)
You might not be able to ReDim to a runtime value?? Not sure, but it might be easier to use an array list.
-
Apr 23rd, 2003, 02:59 PM
#3
Frenzied Member
From MSDN
The ReDim statement is used to change the size of one or more dimensions of an array that has already been formally declared. ReDim cannot change the rank (the number of dimensions) of the array.
Last edited by Lunatic3; Apr 23rd, 2003 at 03:07 PM.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Apr 23rd, 2003, 03:05 PM
#4
Thread Starter
New Member
VBCrazyCoder
this code is fine!!!
ReDim aryCount(HiCard + 4)
it this code im having problems with
ReDim aryCount(HiCard, Devices)
thanks
-
Apr 23rd, 2003, 03:49 PM
#5
Member
You've have dimmed an array, then redimming it as a multidimentional array.
Dim the array initially with (,)
-
Apr 28th, 2003, 08:22 AM
#6
New Member
Also from MSDN:
If your array has two or more dimensions, you can change the size of only the last dimension if you use Preserve.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|