06/06/08 12:08
antometal
ho un problema nel codice... quando ridimensiono un vettore, tutti dati vanno persi
sono arrivato fin qui
il resto credo sia a posto
sono arrivato fin qui
Private Type cont_rec n As Integer c As Integer End Type Private Sub Command1_Click() Dim i As Integer Dim j As Integer Dim pos As Integer Dim b As Boolean Dim Num() As Integer Dim Cont() As cont_rec For i = 0 To 10 '############# ReDim Num(i) ' Num(i) = Fix(Rnd * 5) 'carica vettore If i > 1 Then Print Num(i - 1) ' Next i '############## ReDim Cont(0) For i = 0 To UBound(Num) b = True For j = 0 To pos If Num(i) = Cont(j).n Then Cont(j).c = Cont(j).c + 1 b = False End If Next j If b = True Then pos = UBound(Cont) + 1 ReDim Cont(pos) Cont(pos).n = Num(i) Cont(pos).c = 1 End If Next i For i = 0 To UBound(Cont) Print Cont(i).n & "x" & Cont(i).c Next i
il resto credo sia a posto
aaa