1 Star 0 Fork 10

joliny / dbooks

forked from mellen / dbooks 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
UnitETL.pas 2.49 KB
一键复制 编辑 原始数据 按行查看 历史
sfm 提交于 2023-06-19 14:08 . 修改bug 下一个文档
unit UnitETL;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, OleCtrls, SHDocVw, StdCtrls, Buttons, jpeg, ExtCtrls,inifiles;
type
Tfrmnianfo = class(TForm)
btnnf: TSpeedButton;
grp1: TGroupBox;
Label2: TLabel;
Label1: TLabel;
labtoday: TLabel;
labtotal: TLabel;
Label3: TLabel;
labh: TLabel;
img2: TImage;
lab5: TLabel;
labdate: TLabel;
procedure btnnfClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure load();
procedure save();
end;
var
frmnianfo: Tfrmnianfo;
implementation
uses UnitData;
{$R *.dfm}
procedure Tfrmnianfo.btnnfClick(Sender: TObject);
var
i,t,h,a:integer;
num:integer;
myinifile: TInifile;
begin
img2.Height:=220;
for I := 0 to 100 do begin
img2.Height:= 220+i;
end;
num:= StrToInt(lab5.Caption);
h:= StrToInt(labh.Caption);
t:=StrToInt(labtoday.Caption);
a:=StrToInt(labtotal.Caption);
num:=num+1;
t:=t+1;
a:=a+1;
lab5.Caption:=IntToStr(num);
if num=10 then begin
lab5.Caption:='0';
h:=h+1;
labh.Caption:= IntToStr(h);
//num:=0;
end;
//a:=a+t;
labtotal.Caption:=IntToStr(a);
labtoday.Caption:=IntToStr(t);
save();
end;
procedure Tfrmnianfo.FormShow(Sender: TObject);
var
i:integer;
num:integer;
myinifile: TInifile;
g_path,h,today,total:string;
begin
load();
end;
procedure Tfrmnianfo.load();
var
i:integer;
num:integer;
myinifile: TInifile;
g_path,h,today,total,d:string;
begin
g_path := ExtractFileDir(ParamStr(0));
myinifile := TInifile.Create(g_path + '\address.ini');
labtoday.Caption := myinifile.ReadString('zl', 'today', '');
labtotal.Caption := myinifile.ReadString('zl', 'total', '');
labh.Caption:= myinifile.ReadString('zl', 'h', '');
labdate.Caption := myinifile.ReadString('zl', 'day', '');
d:=FormatDateTime('yyyymmdd', Now());
if (d <> labdate.Caption) then begin
labdate.Caption:=d;
labtoday.Caption:='0';
end;
end;
procedure Tfrmnianfo.save();
var
i:integer;
num:integer;
myinifile: TInifile;
g_path,h,today,total:string;
begin
g_path := ExtractFileDir(ParamStr(0));
today:=labtoday.Caption;
total:=labtotal.Caption;
myinifile := TInifile.Create(g_path + '\address.ini');
myinifile.WriteString('zl','today',today);
myinifile.WriteString('zl','total', total);
myinifile.WriteString('zl','h',labh.Caption);
myinifile.WriteString('zl','day',FormatDateTime('yyyymmdd', Now()));
end;
end.
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jbakwd/dbooks.git
git@gitee.com:jbakwd/dbooks.git
jbakwd
dbooks
dbooks
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891