📄 main.pas
字号:
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, BusinessSkinForm, bsSkinData, bsSkinCtrls, Grids, DBGridEh,
StdCtrls, Mask, bsSkinBoxCtrls, RzLabel, DB, ADODB, ExtCtrls, DBCtrls,
RzEdit, SUIProgressBar, jpeg, SUIButton, RzButton, ImgList,
RzStatus, RzSpnEdt, RzRadChk;
type
TForm1 = class(TForm)
bsCStoredSkin1: TbsCompressedStoredSkin;
bsSkinData1: TbsSkinData;
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinGroupBox1: TbsSkinGroupBox;
DBGridEh1: TDBGridEh;
RzLabel1: TRzLabel;
RzLabel2: TRzLabel;
RzLabel3: TRzLabel;
RzLabel4: TRzLabel;
RzLabel5: TRzLabel;
RzLabel6: TRzLabel;
RzLabel7: TRzLabel;
RzLabel8: TRzLabel;
RzLabel9: TRzLabel;
RzLabel10: TRzLabel;
RzLabel11: TRzLabel;
RzLabel12: TRzLabel;
RzLabel13: TRzLabel;
RzLabel14: TRzLabel;
RzLabel15: TRzLabel;
RzLabel16: TRzLabel;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
DataSource1: TDataSource;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton1: TbsSkinButton;
RzLabel17: TRzLabel;
RzLabel18: TRzLabel;
bsSkinButton2: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
Label1: TLabel;
RzEdit1: TRzEdit;
RzEdit2: TRzEdit;
bsSkinPanel10: TbsSkinPanel;
OpName: TbsSkinStatusPanel;
bsSkinStatusPanel3: TbsSkinStatusPanel;
bsSkinStatusPanel1: TbsSkinStatusPanel;
bsSkinPanel2: TbsSkinPanel;
bsSkinGroupBox2: TbsSkinGroupBox;
Label4: TLabel;
Lb1: TLabel;
Bar0: TsuiProgressBar;
Lb2: TLabel;
Lb3: TLabel;
Lb4: TLabel;
Lb5: TLabel;
Lb6: TLabel;
Lb7: TLabel;
Lb8: TLabel;
Lb9: TLabel;
Lb0: TLabel;
Bar1: TsuiProgressBar;
Bar2: TsuiProgressBar;
Bar3: TsuiProgressBar;
Bar4: TsuiProgressBar;
Bar5: TsuiProgressBar;
Bar6: TsuiProgressBar;
Bar7: TsuiProgressBar;
Bar8: TsuiProgressBar;
Bar9: TsuiProgressBar;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
bsSkinGroupBox3: TbsSkinGroupBox;
bsSkinPanel3: TbsSkinPanel;
Label2: TLabel;
Label3: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
DXCB1: TsuiCheckBox;
DXCB2: TsuiCheckBox;
DXCB3: TsuiCheckBox;
DXCB4: TsuiCheckBox;
DXCB5: TsuiCheckBox;
DXCB6: TsuiCheckBox;
DXCB7: TsuiCheckBox;
bsSkinButton4: TbsSkinButton;
QoCb1: TsuiCheckBox;
QoCb2: TsuiCheckBox;
QoCb3: TsuiCheckBox;
QoCb4: TsuiCheckBox;
QoCb5: TsuiCheckBox;
QoCb6: TsuiCheckBox;
QoCb7: TsuiCheckBox;
God1: TRzNumericEdit;
God2: TRzNumericEdit;
God3: TRzNumericEdit;
God4: TRzNumericEdit;
God5: TRzNumericEdit;
God6: TRzNumericEdit;
God7: TRzNumericEdit;
RzMemo1: TRzMemo;
RzSpinEdit1: TRzSpinEdit;
RzCheckBox1: TRzCheckBox;
RzCheckBox2: TRzCheckBox;
RzEdit3: TRzEdit;
bsSkinButton5: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
RzCheckBox3: TRzCheckBox;
procedure bsSkinButton1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure DBGridEh1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
procedure bsSkinButton3Click(Sender: TObject);
procedure DBGridEh1TitleBtnClick(Sender: TObject; ACol: Integer;
Column: TColumnEh);
procedure DataSource1DataChange(Sender: TObject; Field: TField);
procedure bsSkinButton4Click(Sender: TObject);
procedure RzCheckBox1Click(Sender: TObject);
procedure RzCheckBox2Click(Sender: TObject);
procedure RzMemo1DblClick(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
private
{ Private declarations }
procedure StrOdd(i, j : integer);
procedure GetGoodNub();
function IntPartToBin(Int: Integer): string;
procedure GetLuckNub();
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function TForm1.IntPartToBin(Int: Integer): string; // 二进制
begin
Result := '';
repeat
Result := Chr(Int mod 2 + Ord('0')) + Result;
Int := Int div 2;
until Int = 0;
end;
procedure TForm1.bsSkinButton1Click(Sender: TObject);
var nub : array[0..6] of integer;
nubstr : array[0..9] of integer;
i,j, gs,dd,xx, jo1,jo2 : integer;
dx,jo, s : string;
begin
if trim(RzEdit2.text)='' then
begin
messagebox(handle,'不能没有开奖期数!','提示',mb_iconerror or mb_OK);
RzEdit2.SetFocus;
exit;
end;
if length(RzEdit2.text)<>7 then
begin
messagebox(handle,'有效录入期数应是7位 ','提示',mb_iconerror or mb_OK);
RzEdit2.SetFocus;
exit;
end;
if trim(RzEdit1.text)='' then
begin
messagebox(handle,'不能没有中奖号码!','提示',mb_iconerror or mb_OK);
RzEdit1.SetFocus;
exit;
end;
if trim(RzEdit1.text)='' then
begin
messagebox(handle,'有效中奖号码应是7位数!','提示',mb_iconerror or mb_OK);
RzEdit1.SetFocus;
exit;
end;
dx:='';
jo:='';
dd:=0;
xx:=0;
jo1:=0;
jo2:=0;
for i:=1 to 7 do
begin
gs := StrToInt(copy(RzEdit1.Text,i,1));
nub[i-1]:=gs;
if gs>4 then
begin
dx := dx+'■'; //大
inc(dd);
end else begin
dx := dx+'□'; // 小
inc(xx);
end;
if odd(gs) then
begin
jo := jo+'●';
inc(jo1);
end else begin
jo := jo+'○'; //偶
inc(jo2);
end;
end;
for i:=0 to 9 do
nubstr[i]:=0;
for i:=0 to 6 do
case nub[i] of
0 : inc(nubstr[0]);
1 : inc(nubstr[1]);
2 : inc(nubstr[2]);
3 : inc(nubstr[3]);
4 : inc(nubstr[4]);
5 : inc(nubstr[5]);
6 : inc(nubstr[6]);
7 : inc(nubstr[7]);
8 : inc(nubstr[8]);
9 : inc(nubstr[9]);
end;
s:='';
for i:=0 to 9 do
begin
if i=0 then
if nubstr[i]<>0 then
s := IntToStr(i)+IntToStr(nubstr[i])
else
s:= s+' '
else
if nubstr[i]<>0 then
s:= s+'|'+IntToStr(i)+IntToStr(nubstr[i])
else
s:= s+'| ';
if nubstr[i]<>0 then
inc(j);
end;
RzLabel14.Caption := s;
s:='';
for i:=0 to 6 do // 201 方程
begin
s:= s+ IntToStr(nub[i] mod 3);
end;
RzLabel16.Caption := s;
//------------------------------------------------------------------------//
RzLabel9.Caption := IntToStr(nub[1]+nub[2]+nub[3]+nub[4]+nub[5]+nub[6]+nub[0]);
RzLabel10.Caption :=dx;
RzLabel11.Caption := IntToStr(dd)+':'+IntToStr(xx);
RzLabel12.Caption :=jo;
RzLabel13.Caption := IntToStr(jo1)+':'+IntToStr(jo2);
RzLabel15.Caption := IntToStr(j);
with ADOQuery1 do
begin
append;
fieldbyname('期数').asstring:= RzEdit2.Text;
fieldbyname('中奖号码').asstring:= RzEdit1.Text;
fieldbyname('总和').asstring:= RzLabel9.Caption;
fieldbyname('大小').asstring:= RzLabel10.Caption;
fieldbyname('大:小').asstring:= RzLabel11.Caption;
fieldbyname('奇偶').asstring:= RzLabel12.Caption;
fieldbyname('奇:偶').asstring:= RzLabel13.Caption;
fieldbyname('出号分布').asstring:= RzLabel14.Caption;
fieldbyname('个数').asstring:= RzLabel15.Caption;
fieldbyname('方程').asstring:= RzLabel16.Caption;
for i:=0 to 9 do
if nubstr[i]<>0 then
fieldbyname(IntToStr(i)).asstring:=IntToStr(nubstr[i]);
POST;
end;
RzEdit2.Text:= IntToStr(StrToInt(RzEdit2.Text)+1);
RzEdit1.Text:='';
FormShow(Sender);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ADOConnection1.Close;
ADOConnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;'+ //使用 Jet.OLEDB.4
'Data Source='+ExtractFilePath(Application.Exename)+'data.db;'+ //加数据源
'Persist Security Info=False'; //无密码
ADOConnection1.LoginPrompt:=false; //加载提示关
ADOConnection1.Open;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -