怎样对Tfontstyle这个集合进行操作
怎样对Tfontstyle这个集合进行操作
我要自定义一个Tfontstyle的子集,
然后对该子集进行include操作,怎样实现
问题点数:100、回复次数:5Top
1 楼FrameSniper(http://naoku.net/blogs/framesniper/)回复于 2003-08-02 11:52:31 得分 50
type
TSonFontStyle = set of TFontStyle;
....
Include(TSonFontStyle,SomeValue);Top
2 楼wgy081(把冰山劈开)回复于 2003-08-02 12:01:13 得分 0
for I:=0 to length(charcount)-1 do
begin
{LUOIB fsBold, fsItalic, fsUnderline, fsStrikeOut}
ch:=charcount[i];
case ch of
'L':include(TSonFontStyle,fsUnderline);
'U':include(TSonFontStyle,fsUnderline);
'O':include(TSonFontStyle,fsStrikeOut);
'I':include(TSonFontStyle,fsItalic);
'B':include(TSonFontStyle,fsbold);
end;
end;
我这样写错在那里Top
3 楼xybh97102(冰点)回复于 2003-08-02 12:04:34 得分 50
同意楼上,补充:
type
TSonFontStyle = set of TFontStyle;
procedure TForm1.Button1Click(Sender: TObject);
var
F:TSonFontStyle;
begin
Include(f, fsItalic);
f:=f+[fsUnderline,fsStrikeOut];
end;Top
4 楼FrameSniper(http://naoku.net/blogs/framesniper/)回复于 2003-08-02 12:04:36 得分 0
Case语句的选择因子必须是有顺类型,而不能用非有序类型的如字符传作为选择因子!Top
5 楼xybh97102(冰点)回复于 2003-08-02 12:08:01 得分 0
procedure TForm1.Button1Click(Sender: TObject);
var
F:TSonFontStyle;
i:integer;
ch:char;
charcount:string;
begin
Include(f, fsItalic);
f:=f+[fsUnderline,fsStrikeOut];
for I:=0 to length(charcount)-1 do
begin
{LUOIB fsBold, fsItalic, fsUnderline, fsStrikeOut}
ch:=charcount[i];
case ch of
'L':include(F,fsUnderline);
'U':include(F,fsUnderline);
'O':include(F,fsStrikeOut);
'I':include(F,fsItalic);
'B':include(F,fsbold);
end;
end;
end;Top




