Recent

Author Topic: Key Press  (Read 23019 times)

winni

  • Hero Member
  • *****
  • Posts: 2018
Re: Key Press
« Reply #15 on: October 15, 2020, 06:11:22 pm »
Code: [Select]

initialization
  {$I ake.lrs}


     

also 1 error
ake.pas(31,29) Error: method identifier expected


No, wrong. Two errors.
That the way things run:

Code: Pascal  [Select][+][-]
  1. {$R *.lfm}    
  2.  


Winni

Weitentaaal

  • Jr. Member
  • **
  • Posts: 59
Re: Key Press
« Reply #16 on: October 23, 2020, 10:55:11 am »
Thanks Jamie
 :)

wp

  • Hero Member
  • *****
  • Posts: 7760
Re: Key Press
« Reply #17 on: October 23, 2020, 11:25:41 am »
Code: [Select]

initialization
  {$I ake.lrs}


     

also 1 error
ake.pas(31,29) Error: method identifier expected


No, wrong. Two errors.
That the way things run:

Code: Pascal  [Select][+][-]
  1. {$R *.lfm}    
  2.  
Winni, this is an almost 10 years old thread started at a time when Lazarus had not yet been able to work with .res resources. The syntax to $Include the lrs file in the initialization section is absolutely correct, it still can be used today, but the preferred way, of course, is to link the .res resource by means of the {$R directive, as you show. (https://wiki.lazarus.freepascal.org/Lazarus_Resources#Lazarus_resources).

The reason why the OP of that thread had seen the "method identifer expected" error was that he had added the TForm1.FormKeyDown to the implementation part of the unit, but not to the class declaration in the interface part.

Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

 

TinyPortal © 2005-2018