And I can also do this instead of a loop:
function TInvestmentEnum(const IT: shortstring): TInvestment;
begin
Result := GetEnumValue(TypeInfo(TInvestment), 'it'+IT)
end;
Again accounting for the 2 characters I stripped out.
Or to further generalize it. I can do
function TInvestmentEnum(const IT: shortstring): TInvestment;
var S:shortstring[2];
begin
S := copy(GetEnumName(TypeInfo(TInvestment), ord(0)),1,2);
Result := GetEnumValue(TypeInfo(TInvestment), S+IT)
end;
So the two rountines now look like this:
function TInvestmentDesciption(const IT: TInvestment): shortstring;
begin
Result := copy(GetEnumName(TypeInfo(TInvestment), ord(IT)),3,255);
end;
function TInvestmentEnum(const IT: shortstring): TInvestment;
var S:shortstring[2];
begin
S := copy(GetEnumName(TypeInfo(TInvestment), ord(0)),1,2);
Result := GetEnumValue(TypeInfo(TInvestment), S+IT)
end;