Error with RECT structure

Started by iwrbc, June 23, 2022, 05:40:41 PM

Previous topic - Next topic

iwrbc

Hi, I encounter a strange problem. It is about this code:
  RECT rc;
  rc.left = 1;
  rc.top = 1;

I chose the member 'top' from the dropdown of suggestions, yet the third line gives me the errors:
error #2047: Expected a member name.
error #2001: Syntax error: expected ';' but found 'integer constant'.
error #2088: Lvalue required.

Yet 'top' is a member of RECT, and elsewhere in the program exactly the same line compiles fines...
Any suggestions?

frankie

Hello iwrbc,
I can't reproduce your error here.
Please provide a minimal verifiable sample.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

iwrbc

Yes, I expected that question, but it is in a program of almost 20000 lines... I will see what I can do, thanks anyway.

frankie

Quote from: iwrbc on June 23, 2022, 06:16:29 PM
Yes, I expected that question, but it is in a program of almost 20000 lines... I will see what I can do, thanks anyway.
I understand, but the cause should be elsewhere, probably a redefinition somewhere.
With this exercise hopefully you'll find the problem by yourself  8)
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

John Z

Hi iwrbc,

Clearly the syntax is correct.  So the issue is elsewhere.
For example it would help to know the line numbers given in the compile error report, and the source line number of the RECT rc; line?
Do you use multiple source files?  Is 'rc' a global or local variable.
You can search for rc and see is inadvertently redefined somewhere like INT rc;
Turn on Level 2 warnings might provide some more information.

John Z