Forum > Beginners

problem with assigning values to a record

(1/1)

noob:
hi,

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?

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

noob:
struct.inc opens at:


--- Code: ---     POINT = record
          x : LONG;
          y : LONG;
       end;
     LPPOINT = ^POINT;
     tagPOINT = POINT;
     TPOINT = POINT;
     PPOINT = ^POINT;

--- End code ---

noob:
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

Leledumbo:
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.

Navigation

[0] Message Index

Go to full version