Slt!
Je bosse sur un algo matriciel de pcc en VB6.0 et j'ai un problème à ce niveau:
Je dois récupérer dans trois boucles imbriquées les valeurs entières de certaines cellules, mzis je sais pas quelle propriété utiliser.
Le problème qui se pose est une erreur de type incompatible.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 For k = 1 To matrice.Rows For i = 1 To matrice.Rows p.TextMatrix(0, 0) = matfloyd.TextMatrix(0, i) For j = 1 To matrice.Cols ' On recherche les fils optimaux et affiche la matrice du PCC. If Val(matfloyd.TextMatrix(i, k)) < pgv And Val(matfloyd.TextMatrix(k, j)) < pgv And Val((matfloyd.TextMatrix(i, k)) + Val(matfloyd.TextMatrix(k, j))) < Val(matfloyd.TextMatrix(i, j)) Then matfloyd.TextMatrix(i, j) = Val(matfloyd.TextMatrix(i, k)) + Val(matfloyd.TextArray(k, j)) p.TextMatrix(i, j) = matfloyd.TextMatrix(0, k) Else p.TextMatrix(i, j) = matfloyd.TextMatrix(0, j) End If Next j Next i Next k
Etant donné que la matrice est parcourue avec trois boucles, quelle propriété dois-je utiliser pour récupérer les valeurs des cellules en tant qu'entier pour des opérations.
J'ai même essayé de les convertir en Int, mais sans succès.
Merci
TM018
Partager