Lazarus

Programming => LCL => Topic started by: dietmar on September 26, 2021, 07:01:49 pm

Title: Compile error with forms
Post by: dietmar on September 26, 2021, 07:01:49 pm
Hi,

on my main form, the following is working (f is a TForm):
f.BoundsRect := Rect(0,0,ClientWidth, ClientHeight);

on all other forms, this line results in the compile error
"Syntax error, ")" expected but "," found"

It seems that the compiler expects "Rect(0)"...

I searched through my source code - no "Rect" function, variable or whatever found.
What is going wrong here?

Thx,
--Dietmar
Title: Re: Compile error with forms
Post by: jamie on September 26, 2021, 08:31:41 pm
You have another identifier of that name with different type nearer in scope references.

rest your cursor on the identifier and allow for Code tools to display the source of it.
Title: Re: Compile error with forms
Post by: Thaddy on September 26, 2021, 08:36:21 pm
At least on Windows, there are two rect() definitions. One in the Windows unit.
Try changing unit order.
Title: Re: Compile error with forms
Post by: dietmar on September 26, 2021, 08:56:05 pm
Jep, that made it... thx a lot!

--Dietmar
Title: Re: Compile error with forms
Post by: trev on September 27, 2021, 01:35:02 am
Jep, that made it... thx a lot!

Which solution did you use - jamie or Thaddy?
Title: Re: Compile error with forms
Post by: dietmar on October 01, 2021, 08:15:18 pm
To be honest: The solution of Thaddy was absolutely sufficient ;)

--Dietmar
TinyPortal © 2005-2018