//ini文件读写操作
function ReadAndWriteIni(fileName,sSection,sIdent,sValue:string;isboolean:Integer):string;
var
tini : TIniFile;
begin
try
tini := TIniFile.Create(ExtractFilePath(ParamStr(0))+fileName);
if isboolean = 0 then
begin
Result := tini.ReadString(sSection,sIdent,'');
end
else
begin
Result := tini.WriteString(sSection,sIdent,sValue);
end;
finally
tini.Destroy;
end;
end;
//下面是函数调用
ReadAndWriteIni('config.ini','config','user','',0);
编译是错误的信息:Incompatible types: 'String' and 'procedure, untyped pointer or untyped parameter'
function ReadAndWriteIni(fileName,sSection,sIdent,sValue:string;isboolean:Integer):string;
var
tini : TIniFile;
begin
try
tini := TIniFile.Create(ExtractFilePath(ParamStr(0))+fileName);
if isboolean = 0 then
begin
Result := tini.ReadString(sSection,sIdent,'');
end
else
begin
Result := tini.WriteString(sSection,sIdent,sValue);
end;
finally
tini.Destroy;
end;
end;
//下面是函数调用
ReadAndWriteIni('config.ini','config','user','',0);
编译是错误的信息:Incompatible types: 'String' and 'procedure, untyped pointer or untyped parameter'
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货