JPHamlett
2010-08-13 21:18:20
I there a way to do this using simba I ve been trying to make my own for a little while and I have been failing
2010-08-13 21:18:20
2010-08-13 21:28:53
2010-08-13 21:38:53
tpointarr := [point(1, 1), point(2, 2)]
string := 'point(1, 1), point(2, 2)';
2010-08-13 21:39:02
function TPAToStr(P: TPointArray): String;
var
I: Integer;
begin
for I := 0 to high(P) do
Result := Result + 'point' + toStr(p[I]) + ', ';
Result := copy(Result, 1, length(Result) - 2);
end; Is that what you want?
2010-08-13 21:43:26
program new;
{$I SRL/SRL.scar}
var TSA: TStringArray;
I: Integer;
function TPAtoTSA(TPA: TPointArray): TStringArray;
var I: Integer;
begin
SetArrayLength(Result, Length(TPA));
for I := 0 to High(TPA) do begin
Result[I] := IntToStr(TPA[I].X)+','+IntToStr(TPA[I].Y);
end;
end;
begin
SetupSRL;
TSA := TPAtoTSA([Point(0, 0), Point(1, 1), Point(2, 2), Point(3, 3)]);
for I := 0 to High(TSA) do begin
Writeln(TSA[I]);
end;
end.
2010-08-14 01:20:16