Generates a TPoint value from X and Y values Classes unit
 function Point(const X, Y Integer):TPoint;
The Point function takes X and Y parameter values and returns a TPoint value containing them.
Related commands
BoundsCreate a TRect value from top left and size values
PointsEqualCompares two TPoint values for equality
PtInRectTests to see if a point lies within a rectangle
RectCreate a TRect value from 2 points or 4 coordinates
TPointHolds X and Y integer values
TRectHolds rectangle coordinate values
 Download this web site as a Windows program.

Example code : Assign 2 TPoint variables manually and using Point
  start, finish : TPoint;

  // Set up the start point directly
  start.X := 1;
  start.Y := 2;

  // Set up the finish point using the Point method
  finish := Point(1, 2);

  // Is the start point equal to the finish point?
  if PointsEqual(start, finish)
  then ShowMessage('start =  finish')
  else ShowMessage('start <> finish');
Show full unit code
  start = finish
Delphi Programming © Neil Moffatt 2002 - 2022. All rights reserved.  |  Home Page