S
savetime
Unregistered / Unconfirmed
GUEST, unregistred user!
原D5中以下语句或函数没有问题
Application.MessageBox(STRING_NO_GRANT,
PChar(Application.Title), MB_ICONWARNING + MB_OK);
function TDM.SumField(ADataSet: TDataSet
AFieldName: string): Variant;
var
CurrBookmark: TBookmark;
begin
Result := 0;
if ADataSet.Eof and ADataSet.Bof then Exit;
CurrBookmark := ADataSet.GetBookmark;
ADataSet.DisableControls;
try
ADataSet.First;
while not ADataSet.Eof do
begin
Result := Result + ADataSet[AFieldName];
ADataSet.Next;
end;
finally
ADataSet.GotoBookmark(CurrBookmark);
ADataSet.FreeBookmark(CurrBookmark);
ADataSet.EnableControls;
end;
end;
用D7编译后出现以下警告,但可以运行
Build
[Warning] DataModule.pas(48): Unsafe type 'TBookmark'
[Warning] DataModule.pas(53): Unsafe type 'CurrBookmark: Pointer'
[Warning] DataModule.pas(63): Unsafe type 'CurrBookmark: Pointer'
[Warning] DataModule.pas(64): Unsafe type 'CurrBookmark: Pointer'
[Warning] SingleFrm.pas(131): Unsafe type 'PChar'
[Warning] SingleFrm.pas(176): Unsafe type 'PChar'
[Warning] MasterFrm.pas(210): Unsafe type 'PChar'
[Warning] MasterFrm.pas(238): Unsafe type 'PChar'
[Warning] MasterFrm.pas(345): Unsafe type 'PChar'
[Warning] MainFrm.pas(119): Unsafe type 'PChar'
[Warning] MainFrm.pas(138): Unsafe type 'PChar'
[Warning] MainFrm.pas(157): Unsafe type 'PChar'
[Warning] MainFrm.pas(176): Unsafe type 'PChar'
[Warning] CoolHint.pas(66): Unsafe type 'PChar'
D7在数据转换方面与D5有什么不同,哪位给讲讲!
Application.MessageBox(STRING_NO_GRANT,
PChar(Application.Title), MB_ICONWARNING + MB_OK);
function TDM.SumField(ADataSet: TDataSet
AFieldName: string): Variant;
var
CurrBookmark: TBookmark;
begin
Result := 0;
if ADataSet.Eof and ADataSet.Bof then Exit;
CurrBookmark := ADataSet.GetBookmark;
ADataSet.DisableControls;
try
ADataSet.First;
while not ADataSet.Eof do
begin
Result := Result + ADataSet[AFieldName];
ADataSet.Next;
end;
finally
ADataSet.GotoBookmark(CurrBookmark);
ADataSet.FreeBookmark(CurrBookmark);
ADataSet.EnableControls;
end;
end;
用D7编译后出现以下警告,但可以运行
Build
[Warning] DataModule.pas(48): Unsafe type 'TBookmark'
[Warning] DataModule.pas(53): Unsafe type 'CurrBookmark: Pointer'
[Warning] DataModule.pas(63): Unsafe type 'CurrBookmark: Pointer'
[Warning] DataModule.pas(64): Unsafe type 'CurrBookmark: Pointer'
[Warning] SingleFrm.pas(131): Unsafe type 'PChar'
[Warning] SingleFrm.pas(176): Unsafe type 'PChar'
[Warning] MasterFrm.pas(210): Unsafe type 'PChar'
[Warning] MasterFrm.pas(238): Unsafe type 'PChar'
[Warning] MasterFrm.pas(345): Unsafe type 'PChar'
[Warning] MainFrm.pas(119): Unsafe type 'PChar'
[Warning] MainFrm.pas(138): Unsafe type 'PChar'
[Warning] MainFrm.pas(157): Unsafe type 'PChar'
[Warning] MainFrm.pas(176): Unsafe type 'PChar'
[Warning] CoolHint.pas(66): Unsafe type 'PChar'
D7在数据转换方面与D5有什么不同,哪位给讲讲!