Recent

Author Topic: Error: Duplicate identifier "Forms"  (Read 2740 times)

LinNan2002

  • Newbie
  • Posts: 4
Error: Duplicate identifier "Forms"
« on: June 21, 2018, 10:04:09 am »
"var
  FormS: TFormS; "

"units.pas(24,3) Error: Duplicate identifier "Forms""  What's Wrong With That?

RayoGlauco

  • Full Member
  • ***
  • Posts: 176
  • Beers: 1567
Re: Error: Duplicate identifier "Forms"
« Reply #1 on: June 21, 2018, 10:36:49 am »
Hi, LinNan,

There is a unit called forms. Probably you cannot declare a variable with the same name.
To err is human, but to really mess things up, you need a computer.

Thaddy

  • Hero Member
  • *****
  • Posts: 14204
  • Probably until I exterminate Putin.
Re: Error: Duplicate identifier "Forms"
« Reply #2 on: June 21, 2018, 03:36:00 pm »
There is a unit called forms. Probably you cannot declare a variable with the same name.
Leave out probably: you can't if you are writing a GUI application. You should use something like myforms or formsarray instead.
Note the Pascal language is not case-sensitive so formS is the same as Forms or fOrMs.
Specialize a type, not a var.

reinerr

  • New Member
  • *
  • Posts: 37
Re: Error: Duplicate identifier "Forms"
« Reply #3 on: June 22, 2018, 07:05:00 am »
I always give my GUI controls (including forms) a prefix - a legacy from my work. In our case, form names are usually prefixed with "FRM_", edit control names are prefixed with "EDT_", etc.

 

TinyPortal © 2005-2018