"Assign" was Niklaus Wirth's name for one of the original file procedures when he designed Pascal.
Unfortunately Borland used the same identifier for a commonly-used method of TPersistent, which copies all a component's data from one instance to another.
Consequently the file routines were renamed with "File" appended to them, to avoid the name clash.
The IDE knows all the identifiers in the FPC runtime library (RTL), whatever is (or is not) in your uses clause, such as AssignFile(), for instance.
However, LCL identifiers are known by the IDE only when the unit that declares them is specified in the uses clause. For this reason a default new project in Lazarus provides a uses clause with several common units specified.
You could try the following program which offers simple logging of mouse movement (don't move the mouse too much or for too long before clicking the Save button or you'll have a huge file). Start a new project in Lazarus and replace the unit1 code with the following, saving the unit as MainLogForm:
unit MainLogForm;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, StdCtrls;
type
{ TLogForm }
TLogForm = class(TForm)
procedure BSaveOnClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure MLoggerMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
private
BSave: TButton;
FStart: TTimeStamp;
MLogger: TMemo;
procedure LogMouse(anX, aY: integer);
end;
var
LogForm: TLogForm;
implementation
{$R *.lfm}
{ TLogForm }
procedure TLogForm.BSaveOnClick(Sender: TObject);
begin
MLogger.Lines.SaveToFile('log.txt');
end;
procedure TLogForm.FormCreate(Sender: TObject);
begin
MLogger:=TMemo.Create(Self);
MLogger.Align:=alLeft;
MLogger.OnMouseMove:=@MLoggerMouseMove;
MLogger.Clear;
MLogger.Parent:=Self;
BSave:=TButton.Create(Self);
BSave.Top :=10;
BSave.Left:=MLogger.Width + 10;
BSave.Caption:='Save log';
BSave.OnClick:=@BSaveOnClick;
BSave.Parent:=Self;
FStart:=DateTimeToTimeStamp(Now);
end;
procedure TLogForm.LogMouse(anX, aY: integer);
function SecsFromStart:integer;
begin
Result:=(DateTimeToTimeStamp(Now).Time - FStart.Time) div 1000;
end;
begin
mLogger.Append(Format('Mouse at (%d,%d) after %d seconds',[anX, aY, SecsFromStart]));
end;
procedure TLogForm.MLoggerMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
LogMouse(X, Y);
end;
end.