Y
ykjt
Unregistered / Unconfirmed
GUEST, unregistred user!
这是网上最常见的介绍多线和的例子,构造函数中的
fQuery:ΚQuery;
FreeOnTerminate:ΚTrue;
为何true和Query前加字母K?
==========================================================
下面就是一个基本的继承TThread生成的多线程类。
QuerThrd.Pas
unitQuerThrd;
interface
uses
Classes,DBTables;
type
TQueryThreadΚclass(TThread)
private
fQuery:tQuery;
protected
procedureExecute;override;
public
constructorCreate(Suspended:Boolean;Query:
TQuery);
end;
implementation
constructor
TQueryThread.Create(Suspended:Boolean;Quer
y:TQuery);
begin
inheritedCreate(Suspended);
fQuery:ΚQuery;
FreeOnTerminate:ΚTrue;
end;
procedureTQueryThread.Execute;
begin
fQuery.Open;
end;
end.
fQuery:ΚQuery;
FreeOnTerminate:ΚTrue;
为何true和Query前加字母K?
==========================================================
下面就是一个基本的继承TThread生成的多线程类。
QuerThrd.Pas
unitQuerThrd;
interface
uses
Classes,DBTables;
type
TQueryThreadΚclass(TThread)
private
fQuery:tQuery;
protected
procedureExecute;override;
public
constructorCreate(Suspended:Boolean;Query:
TQuery);
end;
implementation
constructor
TQueryThread.Create(Suspended:Boolean;Quer
y:TQuery);
begin
inheritedCreate(Suspended);
fQuery:ΚQuery;
FreeOnTerminate:ΚTrue;
end;
procedureTQueryThread.Execute;
begin
fQuery.Open;
end;
end.