//
procedure TDocuInput
begin
datasource
end;
//
procedure TDocuInput
var
sumoutput
i:integer;
begin
suminput:=
sumoutput:=
//統計借貸雙方的數額
for i:=
if (stringgrid
begin
suminput:=suminput+strtofloat(stringgrid
sumoutput:=sumoutput+strtofloat(stringgrid
end;
dbedit
dbedit
end;
procedure TDocuInput
begin
SumAccount;
end;
//
procedure TDocuInput
begin
stringgrid
stringgrid
stringgrid
stringgrid
stringgrid
end;
//
procedure TDocuInput
ARow: Integer; var CanSelect: Boolean);
begin
//防止在輸入數據時上面有空行
if stringgrid
begin
showmessage(
exit;
end;
//保存選取的單元行列值
curRow:=ARow;
curCol:=ACol;
if (curCol<=
stringgrid
//防止選中標題欄
if ARow=
//統計借貸雙方信息
sumAccount();
end;
//
procedure TDocuInput
var
showForm:TShowDllForm;
module:Thandle;
begin
//只有雙擊指定列才有效
if curCol<>
//讀入DLL
module:=loadlibrary(
//如果讀入錯誤
//由此可以判斷是否讀入成功
if module<
@showForm:=getprocaddress(module
if @showForm=nil then exit;
//通過DLL傳遞參數
stringgrid
//為科目代碼添加科目名稱
adoquery
adoquery
adoquery
=
adoquery
stringgrid
end;
[
From:http://tw.wingwit.com/Article/program/Delphi/201311/24841.html