Page 1 of 1

How convert c++ code ?

PostPosted: December 11th, 2010, 2:20 pm
by sesilla
Hi all,

i have a problem, it's possible to convert this c++ code into delphi. Any chance or workaround?

Code: Select all
list<Vector2> vList;
const Vector2 vMin = 1.2f;
const Vector2 vMax = 8.9f;
 
list.clear();
for (float y = vMin.y; y<=vMax.y; y+=1.0f)
{
    for (float x = vMin.x; x<=vMax.x; x+=1.0f)
    {
   outList.push_back(Vector2(x, y));
    }
}


Thanks in advance
Sesilla

Re: How convert c++ code ?

PostPosted: November 16th, 2011, 9:51 am
by programador
Code: Select all
var
vList:tlist<Vector2>;
x,y:float;
const
vMin:Vector2  = 1.2f;
vMax:Vector2 = 8.9f;
begin

for y: = vMin.y to vMax.y Step 1.0f do begin
    for x: = vMin.x to vMax.x Step 1.0f do begin
        outList.push_back(Vector2(x, y));
    end;
end;

end;