fontstyle是集合吧[fsbold,fsita..]
var
pfont:Tfontstyle;
begin
...
xx:=reg.writestring('fontstyle');
if pos('fsbold',xx)<>0 then
pfont=[fsbold]
if pos('fsitla..',xx)<>0 then
pfont:=pfont+[fsbold]
做过的,忘了,大概这个样子,你试试看
var
pfont:Tfontstyle;
begin
...
xx:=reg.writestring('fontstyle');
if pos('fsbold',xx)<>0 then
pfont=[fsbold]
if pos('fsitla..',xx)<>0 then
pfont:=pfont+[fsbold]
做过的,忘了,大概这个样子,你试试看
const
FontStyleNames: array [TFontStyle] of String = ('Bold', 'Italic', 'Underline', 'StrikeOut');procedure WriteFontStylesToReg( AFont: TFont; reg: TRegistry );
var
fs: TFontStyle;
begin
for fs:=Low(TFontStyle) to High(TFontStyle) do
reg.WriteBool( FontStyleNames, fs in AFont.Style );
end;procedure ReadFontStylesFromReg( AFont: TFont; reg: TRegistry );
var
fs: TFontStyle;
FStyle: TFontStyles;
procedure ReadAFontStyle( const StyleName: String; StyleValue: TFontStyle );
begin
if reg.ValueExists(StyleName) and reg.ReadBool(StyleName) then
Include( FStyle, StyleValue )
else
Exclude( FStyle, StyleValue );
end;
begin
FStyle := AFont.Style;
for fs:=Low(TFontStyle) to High(TFontStyle) do
ReadAFontStyle( FontStyleNames, fs );
AFont.Style := FStyle;
end;写时:
WriteFontStylesToReg( Control1.Font, reg );
读时:
ReadFontStylesFromReg( Control1.Font, reg );
既然是三层,有两个办法实现模糊查询:
a.设置TDataSetProvider的Option为poAllowCommandText,这时在客户端便可以使用SQL语句:
ClientDataSet.CommandText := 'Select * from table where a like '%ss%';
ClientDataSet.Close;
ClientDataSet.Open;b.调用中间层接口:
SocketConnection1.Appserver.MySql('Select * ....');
ClientDataSet.Close;
ClientDataSet.Open;
中间层MySQL函数:
procedure MySQL(s: string);
begin
query1.close;
query1.sql.text := s;
Query1.Open;
end;
不知这样回答,你是否满意?