Команды - строки с префиксом cm_, как в TC. главное- определение команды по данной строке, ф-ция CmdId.
Код: Выделить всё
unit Cmd;
interface
type
TCmd = (cm_None, cm_List1, cm_List2, cm_List3);
const
SCmd: array[TCmd] of string = ('', 'cm_List1', 'cm_List2', 'cm_List3');
function CmdId(const S: string): TCmd;
implementation
uses SysUtils;
function CmdId(const S: string): TCmd;
var
i: TCmd;
begin
Result := cm_None;
for i := Low(TCmd) to High(TCmd) do
if UpperCase(SCmd[i]) = UpperCase(S) then
begin
Result := i;
Break
end;
end;
end.