Forum > Beginners

problem with assigning values to a record



this problem puzzles me, i can't compile my program - please help.

the declaration and the mode

--- Code: ---{$mode objfpc}{$H+}
point5: ARRAY[0..4] OF Tpoint;

--- End code ---

i try ti assign some values to a point:

--- Code: ---point5[0] := point(xm, ym);

--- End code ---
andd it fails with
xygrph30\xygraph3d.pas(2086,26) Fatal: Syntax error, ")" expected but "," found

what am i doing wrong?

Press Ctrl and click on "point". What unit will open ?

noob: opens at:

--- Code: ---     POINT = record
          x : LONG;
          y : LONG;
     tagPOINT = POINT;

--- End code ---

thank you for this hint. i found the problem.
if i use Windows as the first include in the USE statement the error is GONE!!

thank you very much

Both Windows and Classes (and also Types) unit declare Point identifier, but for different purpose. In Windows, it's a record data type. In Classes/Types, it's a function returning TPoint record. Read the docs about relationship of identifier searching and unit order in uses clause.


[0] Message Index

Go to full version