Polygon points (Solved) lazarus / 10-Designer ---------------------------------------------------------------------- Degibbo · 2017-08-01 07:59 G'day all, This is probably not the best place to post this, so I will take suggestions (don't want to upset anybody). Drawing a polygon on a canvas, the code line is: Polygon([Point(a,b), point(b,c) etc ]); The compiler expresses that after the 1st variable (a) that ")" was expected but "," found. Many examples that I have looked at, tend to be equivalent to my line of code. Is there a trick to using Point() other than creating an array?  The compile fails even with a simple reference to Point such as (for example): Var   Q :  TPoint;   a,b : integer;   a := 1;   b := 2;   Q := Point(a,b);  same problem.   Any suggestions?  (OBTW it worked OK in Delphi) Thanks, DG ---------------------------------------------------------------------- marcov · 2017-08-01 08:02 Point is an old windows macro, and probably part of the Windows unit, and as such not part of the portable subset of the VCL. Might work with lazarus too if you include unit windows. ---------------------------------------------------------------------- Thaddy · 2017-08-01 08:07 It should work with lclintf instead of windows. If it doesn't, there's a simple solution. ---------------------------------------------------------------------- balazsszekely · 2017-08-01 08:09 It works fine with fpc 3.02. Point is declared in unit classes: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function Point(AX, AY: Integer): TPoint;begin  with Result do  begin    X := AX;    Y := AY;  end;end;   The following code also works: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Form1.Canvas.Polygon([Point(2,2), Point(120, 140), Point(2, 75)]); ---------------------------------------------------------------------- Thaddy · 2017-08-01 08:13 Quote from: GetMem on August 01, 2017, 10:09:23 amIt works fine with fpc 3.02. Point is declared in unit classes: It is also declared in unit types which in this case is the correct one. ---------------------------------------------------------------------- balazsszekely · 2017-08-01 08:25 The issue only occurs when windows is in the uses clauses. As @marcov already mentioned Point is a windows specific structure/record. @Degibbo use it like this: classes.Point or types.Point ---------------------------------------------------------------------- Thaddy · 2017-08-01 09:01 Quote from: GetMem on August 01, 2017, 10:25:23 amThe issue only occurs when windows is in the uses clauses. As @marcov already mentioned Point is a windows specific structure/record. @Degibbo use it like this: classes.Point or types.Point Correct. Of course not the part about windows specific, because it isn't. TPoint(s) needs a clean up. ---------------------------------------------------------------------- Degibbo · 2017-08-02 00:06 G'day all, Thanks for all the hints!  The trick was to include the unit "Types". "Windows" was also included but not needed.  I got the points OK now. Cheers & thanks for the support, DG