0

I have an Action List on a Form and a Frame (a unit of a Form is impelemented in the Frame).

I set Form2.General.State:=asSuspended in the Frame, and I have an error: Undeclared identifier: 'asSuspended'.

The code works normally in the Form, but not in the Frame.

Why?

Thanks!!!

menjaraz
  • 7,551
  • 4
  • 41
  • 81
maxfax
  • 4,281
  • 12
  • 74
  • 120

2 Answers2

3

Add the unit in which asSuspended is defined to the uses clause of the frame unit.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
3

It seems like you just have to add ActnList to the uses clause of the unit in which the error appears.

Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384
  • I told you to add `ActnList`, not `General`. – Andreas Rejbrand Jul 06 '11 at 21:41
  • The problem was that the compiler didn't know what `asSuspended` was. Therefore, you need to add `ActnList`, the unit in which `asSuspended` is defined. `General` is the *name* that *you* gave to a particular instance of a `TActionList` -- of course there is no *unit* called `General`! – Andreas Rejbrand Jul 06 '11 at 21:44
  • 4
    You should not add `General` to the uses list! There is no unit called `General`! You should add `ActnList` to the uses list, because `ActnList` is the unit in which `asSuspended` is defined! That is, do NOT write `uses General`. Instead, write `uses ActnList`. – Andreas Rejbrand Jul 06 '11 at 21:45