program typed_const;

{$mode objfpc}{$H+}

Function GetAName: string;
const lastName: string = '';
var constName: string = 'Lazarus';
begin
	WriteLn('[Last name entered was "', lastName, '"]');
	WriteLn('[Value of constName is "', constName, '"]');
	Write('Enter a new name: ');
	ReadLn(Result);
	lastName := Result;
end;

begin
		WriteLn('First invocation of GetAName');
		WriteLn(GetAName);
		WriteLn;
		WriteLn('Second invocation of GetAName');
		WriteLn(GetAName);
		WriteLn;
		WriteLn('[Finished]');
		{$IFDEF WINDOWS}
		ReadLn;
		{$ENDIF}
end.

