It's a Lazarus program, but it is not matter anyway. The main form consist of a RadioGroup with 3 choices, a SpeedButton, and an Edit. Here is the main unit:
unit bl;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
LCLType, ComCtrls, FileCtrl, Buttons, ExtCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Edit1: TEdit;
RadioGroup1: TRadioGroup;
SpeedButton1: TSpeedButton;
procedure SpeedButton1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
const
sRule='§';
sAdvise='!';
sInfo='-';
implementation
function TranslateChar(Sign: Char): string;
begin
case Sign of
sRule: Result:='Rule: ';
sAdvise: Result:='Advise: ';
sInfo: Result:='Information: ';
else
Result:='';
end;
end;
{ TForm1 }
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
case RadioGroup1.ItemIndex of
0: Edit1.Text:=TranslateChar(sRule);
1: Edit1.Text:=TranslateChar(sAdvise);
2: Edit1.Text:=TranslateChar(sInfo);
end;
end;
initialization
{$I bl.lrs}
end.
The compiler error messages are:
Hint: Start of reading config file F:\lazarus\fpc\2.6.4\bin\i386-win32\fpc.cfg
Hint: End of reading config file F:\lazarus\fpc\2.6.4\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.6.4 [2014/10/11] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling blprj.lpr
Compiling bl.pas
bl.pas(39,10) Error: Constant and CASE types do not match
bl.pas(39,10) Error: Ordinal expression expected
bl.pas(52,39) Error: Incompatible type for arg no. 1: Got "Constant String", expected "Char"
bl.pas(36,10) Hint: Found declaration: TranslateChar(Char):AnsiString;
bl.pas(63) Fatal: There were 3 errors compiling module, stopping