LordJashin Posted November 21, 2012 Share Posted November 21, 2012 (edited) Like swapping a TPoints x, and y values. So that now x has y's value, etc. Do that for the whole TPA? For instance: [scar] program aaa; procedure SwapPoint(var Point1: TPoint); begin Point1 := Point(Point1.Y, Point1.X); end; var Point1: TPoint; begin Point1 := Point(3, 5); WriteLn(PointToStr(Point1)); SwapPoint(Point1); WriteLn(PointTOStr(Point1)); end. [/scar] I thought there was functions to do this? Or were they removed and why? Maybe I'll post this on the bug tracker... EDIT: Weird MSSL doesn't have it either. This definitely should be added. In math, swapping of x's and y's is very important with somethings... Like this maybe: [scar] function TPASwap(TPA: TPointArray): TPointArray; var i: Integer; begin Result := CopyTPA(TPA); for i := 0 to high(Result) do Result := Point(Result.Y, Result.X); end; [/scar] Edited November 21, 2012 by LordJashin Quote Link to comment Share on other sites More sharing options...
mormonman Posted November 22, 2012 Share Posted November 22, 2012 Why waste all that memory? Just use a procedure: procedure TPASwap(var TPA: TPointArray); Quote Link to comment Share on other sites More sharing options...
LordJashin Posted November 22, 2012 Author Share Posted November 22, 2012 Just wrote it really quick as an example. I've posted a suggestion for this on the bug tracker... Quote Link to comment Share on other sites More sharing options...