VB6 Require some help with looping
Posted
by k80sg
on Stack Overflow
See other posts from Stack Overflow
or by k80sg
Published on 2010-05-19T09:57:38Z
Indexed on
2010/05/19
10:00 UTC
Read the original article
Hit count: 161
Hi, I am trying to convert a source from C++ to vb6:
C++:
static double mdArray[3][3];
static double mdArray2[3][3];
for (i = 0; i < 3; i++)
for (j = 0; j < 3; j++)
{
double sum = 0;
for(k = 0; k < 3; k++)
sum = sum + mdArray[k][i] * mdArray[k][k];
mdArray2[i][j] = sum
}
VB6:
dim mdArray(0 to 2, 0 to 2) as integer
dim mdArray2(0 to 2, 0 to 2) as integer
for i = 0 to 2
for j = 0 to 2
dim a as double
sum = 0
for k = 0 to 2
sum = sum + mdArray(k,i) * mdArray(k,j)
mdArray2(i,j) = sum
Next
Next
Next
Will the vb6 version yield the same result as the C++ version? Thanks.
© Stack Overflow or respective owner