type
TStatus = (fsNormal {N}, fsEditedOnScreen {O},
fsMissing {M}, fsEstimated {E}, fsSuspect {s},
fsSuspectFromOnScreen {o}, fsSuspectMissing {m},
fsSuspectEstimated {e});
const
StatusValue: array[TStatus] of string = ('N', 'O', 'M', 'E', 's', 'o', 'm', 'e');
function StatusValueToTStatus(C: string): TStatus;
var
I: Integer;
begin
for I := Low(StatusValue) to High(StatusValue) do
begin
if StatusValue[TStatus(I)] = C then
begin
Result := TStatus(I);
EXIT;
end;
end;
//Not found, Manage errors
end;
function StatusToChar(AStatus: TStatus): string;
begin
Result := AStatus.ToString;
end;
procedure TForm1.W3Button5Click(Sender: TObject);
var
ST: TStatus;
ch: string;
begin
ch := 'M';
ST := StatusValueToTStatus(ch);
asm
console.log(@TStatus[ST]);
end;
end;
|