Forum > General

How to Return a string has a enumerated type?

(1/1)

captian jaster:
More specifically, how would I return a string has a TFontStyle?

--- Code: ---  EditBox.Font.Style := FontSet.ReadString('Font','style','[]');
--- End code ---

Thanks..

Martin_fr:
if you dont want to just compare strings by yourself =>
                Value := GetEnumValue(PropType, Ident);
from unit typinfo

IDent: String; // your value
Value: Integer; can be typecasted
PropType: PTypeInfo;

  PropType := PropInfo^.PropType;


and I GUESS:
Function FindPropInfo(AClass: TClass; const PropName: string): PPropInfo;

all in the mentioned unit.

Sorry, don't have a complete example.
Bits and pieces are from TWriter (I think in unit classes)

---
Or search the graphics unit, maybe there is something in there.

captian jaster:

--- Quote from: Martin_fr on August 18, 2010, 06:20:06 pm ---if you dont want to just compare strings by yourself =>
                Value := GetEnumValue(PropType, Ident);
from unit typinfo

IDent: String; // your value
Value: Integer; can be typecasted
PropType: PTypeInfo;

  PropType := PropInfo^.PropType;


and I GUESS:
Function FindPropInfo(AClass: TClass; const PropName: string): PPropInfo;

all in the mentioned unit.

Sorry, don't have a complete example.
Bits and pieces are from TWriter (I think in unit classes)

---
Or search the graphics unit, maybe there is something in there.


--- End quote ---
I never used that unit before.. This might take awhile.. Im gonna search the Graphics unit like you said. Thanks :D
Edit: Nothing in the graphics unit

Navigation

[0] Message Index

Go to full version