Hi everybody!
I have a problem when translating a piece of code from a visual basic program to another in delphi:
I have in vb the following:
i = 1
do while (i < n)
if Vect1(i) = Vect1(i + 1) then
For j = 1 to n
a(i + 1 , j) = a(i + 1 , j) + a(i , j)
a(i , j) = 0
next
end if
i= i + 1
loop
and in delphi
i := 1;
while (i < n) = true do
if Vect1^ = Vect1^[i + 1] then
Begin
For j := 1 to n do
Begin
a^[i + 1 , j] := a^[i + 1 , j] + a^[i , j];
a^[i , j] := 0;
end;
end;
Inc(i);
end;
Vect is a pointer to string and a is a pointer to integer, if it's true then it execute the code.
There's no problem in visual basic but in delphi it's wrong. I don't know why.
Please excuse me for my bad english and thanks if anyone help me
I have a problem when translating a piece of code from a visual basic program to another in delphi:
I have in vb the following:
i = 1
do while (i < n)
if Vect1(i) = Vect1(i + 1) then
For j = 1 to n
a(i + 1 , j) = a(i + 1 , j) + a(i , j)
a(i , j) = 0
next
end if
i= i + 1
loop
and in delphi
i := 1;
while (i < n) = true do
if Vect1^ = Vect1^[i + 1] then
Begin
For j := 1 to n do
Begin
a^[i + 1 , j] := a^[i + 1 , j] + a^[i , j];
a^[i , j] := 0;
end;
end;
Inc(i);
end;
Vect is a pointer to string and a is a pointer to integer, if it's true then it execute the code.
There's no problem in visual basic but in delphi it's wrong. I don't know why.
Please excuse me for my bad english and thanks if anyone help me