unit global;interface
uses SysUtils, Windows,registry,forms,imm,adodb,db;
function initzc: LongInt;
function Dhstr(S:string):string;
var
pubime:string; //输入法
implementationuses FrmDM;
/////////////////////////////////////
function initzc: LongInt;
{$IFDEF WIN32}
var
pdw : pDWord;
mc, fl : dword;
{$ENDIF}
begin
{$IfDef WIN32}
New(pdw);
GetVolumeInformation(nil,nil,0,pdw,mc,fl,nil,0);
Result := pdw^;
dispose(pdw);
{$ELSE}
Result := GetWinFlags;
{$ENDIF}
end;function Dhstr(S:string):string;
var
str:string;
tmp:tadoquery;
begin
{tmp:=tadoquery.Create(self);
tmp.Connection:=dm.ADOConn;
tmp.SQL.Clear;
case S of
'RK':
begin
str:='select max(fdh) as fdh from truku';
end;
end;
tmp.SQL.Add(str);
tmp.Open;
if tmp.FieldByName('fdh').asstring='' then
begin
str:='RK'+format(date,'YYYYMM')+'0001'; Result :=str;
exit;
end;
str:=tmp.fieldbyname('fdh').AsString;
end;
end.
报错:Undeclared identifier:'self'
怎么回事呀。。
uses SysUtils, Windows,registry,forms,imm,adodb,db;
function initzc: LongInt;
function Dhstr(S:string):string;
var
pubime:string; //输入法
implementationuses FrmDM;
/////////////////////////////////////
function initzc: LongInt;
{$IFDEF WIN32}
var
pdw : pDWord;
mc, fl : dword;
{$ENDIF}
begin
{$IfDef WIN32}
New(pdw);
GetVolumeInformation(nil,nil,0,pdw,mc,fl,nil,0);
Result := pdw^;
dispose(pdw);
{$ELSE}
Result := GetWinFlags;
{$ENDIF}
end;function Dhstr(S:string):string;
var
str:string;
tmp:tadoquery;
begin
{tmp:=tadoquery.Create(self);
tmp.Connection:=dm.ADOConn;
tmp.SQL.Clear;
case S of
'RK':
begin
str:='select max(fdh) as fdh from truku';
end;
end;
tmp.SQL.Add(str);
tmp.Open;
if tmp.FieldByName('fdh').asstring='' then
begin
str:='RK'+format(date,'YYYYMM')+'0001'; Result :=str;
exit;
end;
str:=tmp.fieldbyname('fdh').AsString;
end;
end.
报错:Undeclared identifier:'self'
怎么回事呀。。
{tmp:=tadoquery.Create(self);
怎么有一个{出现。
把参数换成application和nil看看
可以改成:
tmp:=tadoquery.Create(nil);或者
tmp:=tadoquery.Create(application);