Hi everyone,
I'm create an array with values in it and those values will be recalculate and put into another array. I used a 'if' function to eliminate some valuse.
The problem that i face is i don't know how to put those newly created values accordingly in the second array.
For example, after i run the programme, the outcome that i got is
i j Array2 But I wan it to be arranged become,
0 0 0 Array2[0,0]=5
0 1 0 Array2[0,1]=3
1 0 5 Array2[1,0]=2
1 1 3 Array2[1,1]=4 only.
2 0 0
2 1 0 How can I do so?
3 0 0
3 1 0
4 0 2
4 1 4
5 0 0
5 1 0
This is the sample programme that i wrote,
for i:=0 to 6-1 do
begin
begin
if Array1[i,0]>0 then
A:=Array1[i,0]+5;
B:=Array1[i,1]-5;
end
begin
Array2[i,j]:=A;
Inc(j);
Array2[i,j]:=B;
j:=0;
A:=0;
B:=0;
end;
end;
I'm create an array with values in it and those values will be recalculate and put into another array. I used a 'if' function to eliminate some valuse.
The problem that i face is i don't know how to put those newly created values accordingly in the second array.
For example, after i run the programme, the outcome that i got is
i j Array2 But I wan it to be arranged become,
0 0 0 Array2[0,0]=5
0 1 0 Array2[0,1]=3
1 0 5 Array2[1,0]=2
1 1 3 Array2[1,1]=4 only.
2 0 0
2 1 0 How can I do so?
3 0 0
3 1 0
4 0 2
4 1 4
5 0 0
5 1 0
This is the sample programme that i wrote,
for i:=0 to 6-1 do
begin
begin
if Array1[i,0]>0 then
A:=Array1[i,0]+5;
B:=Array1[i,1]-5;
end
begin
Array2[i,j]:=A;
Inc(j);
Array2[i,j]:=B;
j:=0;
A:=0;
B:=0;
end;
end;