Recent

Author Topic: Compile error with forms  (Read 2831 times)

dietmar

  • Full Member
  • ***
  • Posts: 170
Compile error with forms
« 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
Lazarus 2.2.0RC1 with FPC 3.2.2 (32 Bit) on Windows10 (64Bit)

Thaddy

  • Hero Member
  • *****
  • Posts: 14364
  • Sensorship about opinions does not belong here.
Re: Compile error with forms
« Reply #1 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.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

dietmar

  • Full Member
  • ***
  • Posts: 170
Re: Compile error with forms
« Reply #2 on: September 26, 2021, 08:56:05 pm »
Jep, that made it... thx a lot!

--Dietmar
Lazarus 2.2.0RC1 with FPC 3.2.2 (32 Bit) on Windows10 (64Bit)

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Compile error with forms
« Reply #3 on: September 27, 2021, 01:35:02 am »
Jep, that made it... thx a lot!

Which solution did you use - jamie or Thaddy?

dietmar

  • Full Member
  • ***
  • Posts: 170
Re: Compile error with forms
« Reply #4 on: October 01, 2021, 08:15:18 pm »
To be honest: The solution of Thaddy was absolutely sufficient ;)

--Dietmar
Lazarus 2.2.0RC1 with FPC 3.2.2 (32 Bit) on Windows10 (64Bit)

 

TinyPortal © 2005-2018