Recent

Author Topic: Error: Identifier not found  (Read 3433 times)

convertDtoL

  • Newbie
  • Posts: 5
Error: Identifier not found
« on: December 12, 2018, 07:59:08 am »
Hi all,

I am trying to compile a really old version of Delphi into Lazarus.
The script I am using is as follows:
Code: [Select]
unit Drawtool;

{$IFDEF FPC}
  {$MODE Delphi}
{$ENDIF}

interface

uses
{$IFnDEF FPC}
  Windows,
{$ELSE}
  LCLIntf, LCLType, LMessages,
{$ENDIF}
  Classes, ExtCtrls, Messages, Graphics, Controls,
  DrawObject, Forms, ShapeSelect, Viewers,
  Menus, Locations, extdlgs, dialogs;


type
  TSelectMode = (smNone, smNetSelect, smMove, smSize);

  TDrawTool = class;
  TCursorMoveEvent = procedure (Sender: TObject; const L: TLocation) of object;

  TDrawingEditor = class(TCustomSimpelDrawing)
  private
    FTool: TDrawTool;
    FCursorLocation: TLocation;
    FOnCursorMove: TCursorMoveEvent;
    procedure SetTool(Value: TDrawTool);
  protected
    procedure ShapesChanged; override;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
    procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
    procedure KeyDown(var Key: Word; Shift: TShiftState); override;
    property Tool: TDrawTool read FTool write SetTool;
    property OnMouseMove;
    property CursorLocation: TLocation read FCursorLocation write FCursorLocation;
    property OnCursorMove: TCursorMoveEvent read FOnCursorMove write FOnCursorMove;
  end;       

The error message I get is as follows:
Drawtool.pas(26,26) Error: Identifier not found "TCustomSimpelDrawing"
Drawtool.pas(26,46) Error: class type expected, but got "<erroneous type>"
Drawtool.pas(42,25) Error: No property found to override
Drawtool.pas(42,25) Fatal: Syntax error, "READ" expected but ";" found
How can I approach this problem?
I tried to see how other classes are used in other scripts but making changes didn't resolved my issue yet.

Thanks in advance for helping me!
« Last Edit: December 21, 2018, 12:05:13 pm by convertDtoL »

damieiro

  • Full Member
  • ***
  • Posts: 200
Re: Error: Identifier not found
« Reply #1 on: December 12, 2018, 08:14:20 am »
Without trying it, it seems typos

For example:
TCustomSimpelDrawing seems a typo.
TCustomSimpLEDrawing...

But without knowing the unit, i can be mistaken and these are the correct names.

Please, use the [code =pascal]  [ /code] in the upper menu for code readability :)
« Last Edit: December 12, 2018, 10:48:47 am by damieiro »

Handoko

  • Hero Member
  • *****
  • Posts: 5150
  • My goal: build my own game engine using Lazarus
Re: Error: Identifier not found
« Reply #2 on: December 12, 2018, 08:46:32 am »
Identifier not found error won't happen if we use Identifier Completion (Delphians call it Code Completion).

Read more about Lazarus Identifier Completion:
http://wiki.lazarus.freepascal.org/Lazarus_IDE_Tools#Identifier_Completion

As @damieiro said you should use code tag when posting code in the forum. Read more:
http://wiki.freepascal.org/Forum#Use_code_tags
« Last Edit: December 12, 2018, 08:52:09 am by Handoko »

 

TinyPortal © 2005-2018