Form.Align not a TPersistent value. This is the TAlign value, which is an enumeration type.
You can convert the enumeration value to a string using this piece of code:
type TEnumConverter = class public class function EnumToInt<T>(const EnumValue: T): Integer; class function EnumToString<T>(EnumValue: T): string; end; class function TEnumConverter.EnumToInt<T>(const EnumValue: T): Integer; begin Result := 0; Move(EnumValue, Result, sizeOf(EnumValue)); end; class function TEnumConverter.EnumToString<T>(EnumValue: T): string; begin Result := GetEnumName(TypeInfo(T), EnumToInt(EnumValue)); end;
You need to add System.TypInfo to use.
Do this to get Form.Align as a string:
S := TEnumConverter.EnumToString(Form.Align)
source share