unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,IniFiles, ComCtrls;type TForm1 = class(TForm) E1: TEdit; E2: TEdit; E3: TEdit; E4: TEdit; E5: TEdit; E6: TEdit; E7: TEdit; E8: TEdit; E9: TEdit; E10: TEdit; E11: TEdit; E12: TEdit; E13: TEdit; E14: TEdit; Button1: TButton; ss1: TEdit; ss2: TEdit; ss3: TEdit; ss4: TEdit; ss5: TEdit; ss6: TEdit; ss7: TEdit; ss8: TEdit; ss9: TEdit; ss10: TEdit; ss11: TEdit; ss12: TEdit; ss13: TEdit; ss14: TEdit; OpenDialog1: TOpenDialog; Button2: TButton; Button3: TButton; F1: TEdit; F2: TEdit; F3: TEdit; F4: TEdit; F5: TEdit; F6: TEdit; F7: TEdit; F8: TEdit; F9: TEdit; F10: TEdit; F11: TEdit; F12: TEdit; F13: TEdit; F14: TEdit; ListBox1: TListBox; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; Label1: TLabel; Label2: TLabel; Label3: TLabel; Button4: TButton; Label4: TLabel; Edit4: TEdit; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure Button3Click(Sender: TObject); procedure Edit1KeyPress(Sender: TObject; var Key: Char); procedure F1Enter(Sender: TObject); procedure F2Enter(Sender: TObject); procedure F3Enter(Sender: TObject); procedure F4Enter(Sender: TObject); procedure F5Enter(Sender: TObject); procedure F6Enter(Sender: TObject); procedure F7Enter(Sender: TObject); procedure F8Enter(Sender: TObject); procedure F9Enter(Sender: TObject); procedure F10Enter(Sender: TObject); procedure F11Enter(Sender: TObject); procedure F12Enter(Sender: TObject); procedure F13Enter(Sender: TObject); procedure F14Enter(Sender: TObject); procedure Button4Click(Sender: TObject); private { Private declarations } s,Directory:String; ab1,ab2,ab3,ab4,ab5,ab6,ab7,ab8,ab9,ab10,ab11,ab12,ab13,ab14:array [1..3] of boolean; // abc:array [1..3] of boolean; Function getnum(a:String;b:byte):String; Function GetE(var aa:String;Temp:string):String; public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}Function TForm1.getnum(a:String;b:byte):String;begin Result:=copy(a,b,1);end;Function TForm1.GetE(var aa:String;Temp:string):String;var sss:integer;begin sss:=Length(aa); result:=Copy(aa,1,Pos(Temp,aa)-1); aa:=Copy(aa,Pos(';',aa)+1,sss);end;procedure TForm1.Button1Click(Sender: TObject);var a:TextFile; TempS,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14:string; x:integer;begin if OpenDialog1.Execute then begin Caption:=OpenDialog1.FileName; ab1[1]:=False;ab1[2]:=False;ab1[3]:=False; //[3] is zero;[2] is one;[1] is three ab2[1]:=False;ab2[2]:=False;ab2[3]:=False; ab3[1]:=False;ab3[2]:=False;ab3[3]:=False; ab4[1]:=False;ab4[2]:=False;ab4[3]:=False; ab5[1]:=False;ab5[2]:=False;ab5[3]:=False; ab6[1]:=False;ab6[2]:=False;ab6[3]:=False; ab7[1]:=False;ab7[2]:=False;ab7[3]:=False; ab8[1]:=False;ab8[2]:=False;ab8[3]:=False; ab9[1]:=False;ab9[2]:=False;ab9[3]:=False; ab10[1]:=False;ab10[2]:=False;ab10[3]:=False; ab11[1]:=False;ab11[2]:=False;ab11[3]:=False; ab12[1]:=False;ab12[2]:=False;ab12[3]:=False; ab13[1]:=False;ab13[2]:=False;ab13[3]:=False; ab14[1]:=False;ab14[2]:=False;ab14[3]:=False; ss1.Text:='';ss2.Text:='';ss3.Text:=''; ss4.Text:='';ss5.Text:='';ss6.Text:=''; ss7.Text:='';ss8.Text:='';ss9.Text:=''; ss10.Text:='';ss11.Text:='';ss12.Text:=''; ss13.Text:='';ss14.Text:=''; TempS:=s; if TempS<>'' then begin E1.Text:=GetE(TempS,';'); E2.Text:=GetE(TempS,';'); E3.Text:=GetE(TempS,';'); E4.Text:=GetE(TempS,';'); E5.Text:=GetE(TempS,';'); E6.Text:=GetE(TempS,';'); E7.Text:=GetE(TempS,';'); E8.Text:=GetE(TempS,';'); E9.Text:=GetE(TempS,';'); E10.Text:=GetE(TempS,';'); E11.Text:=GetE(TempS,';'); E12.Text:=GetE(TempS,';'); E13.Text:=GetE(TempS,';'); E14.Text:=GetE(TempS,';'); end; AssignFile(a,OpenDialog1.FileName); Reset(a); while not eof(a) do begin readln(a,TempS); if TempS<>'' then begin s1:='';s2:='';s3:='';s4:='';s5:='';s6:=''; s7:='';s8:='';s9:='';s10:='';s11:='';s12:=''; s13:='';s14:=''; s1:=getnum(TempS,1);s2:=getnum(TempS,2);s3:=getnum(TempS,3); s4:=getnum(TempS,4);s5:=getnum(TempS,5);s6:=getnum(TempS,6); s7:=getnum(TempS,7);s8:=getnum(TempS,8);s9:=getnum(TempS,9); s10:=getnum(TempS,10);s11:=getnum(TempS,11);s12:=getnum(TempS,12); s13:=getnum(TempS,13);s14:=getnum(TempS,14); if s1='3' then ab1[1]:=true; if s1='1' then ab1[2]:=true; if s1='0' then ab1[3]:=true; if s2='3' then ab2[1]:=true; if s2='1' then ab2[2]:=true; if s2='0' then ab2[3]:=true; if s3='3' then ab3[1]:=true; if s3='1' then ab3[2]:=true; if s3='0' then ab3[3]:=true; if s4='3' then ab4[1]:=true; if s4='1' then ab4[2]:=true; if s4='0' then ab4[3]:=true; if s5='3' then ab5[1]:=true; if s5='1' then ab5[2]:=true; if s5='0' then ab5[3]:=true; if s6='3' then ab6[1]:=true; if s6='1' then ab6[2]:=true; if s6='0' then ab6[3]:=true; if s7='3' then ab7[1]:=true; if s7='1' then ab7[2]:=true; if s7='0' then ab7[3]:=true; if s8='3' then ab8[1]:=true; if s8='1' then ab8[2]:=true; if s8='0' then ab8[3]:=true; if s9='3' then ab9[1]:=true; if s9='1' then ab9[2]:=true; if s9='0' then ab9[3]:=true; if s10='3' then ab10[1]:=true; if s10='1' then ab10[2]:=true; if s10='0' then ab10[3]:=true; if s11='3' then ab11[1]:=true; if s11='1' then ab11[2]:=true; if s11='0' then ab11[3]:=true; if s12='3' then ab12[1]:=true; if s12='1' then ab12[2]:=true; if s12='0' then ab12[3]:=true; if s13='3' then ab13[1]:=true; if s13='1' then ab13[2]:=true; if s13='0' then ab13[3]:=true; if s14='3' then ab14[1]:=true; if s14='1' then ab14[2]:=true; if s14='0' then ab14[3]:=true; end; end; if ab1[1] then ss1.Text:=ss1.Text+'3'; if ab1[2] then ss1.Text:=ss1.Text+' 1'; if ab1[3] then ss1.Text:=ss1.Text+' 0'; if ab2[1] then ss2.Text:=ss2.Text+'3'; if ab2[2] then ss2.Text:=ss2.Text+' 1'; if ab2[3] then ss2.Text:=ss2.Text+' 0'; if ab3[1] then ss3.Text:=ss3.Text+'3'; if ab3[2] then ss3.Text:=ss3.Text+' 1'; if ab3[3] then ss3.Text:=ss3.Text+' 0'; if ab4[1] then ss4.Text:=ss4.Text+'3'; if ab4[2] then ss4.Text:=ss4.Text+' 1'; if ab4[3] then ss4.Text:=ss4.Text+' 0'; if ab5[1] then ss5.Text:=ss5.Text+'3'; if ab5[2] then ss5.Text:=ss5.Text+' 1'; if ab5[3] then ss5.Text:=ss5.Text+' 0'; if ab6[1] then ss6.Text:=ss6.Text+'3'; if ab6[2] then ss6.Text:=ss6.Text+' 1'; if ab6[3] then ss6.Text:=ss6.Text+' 0'; if ab7[1] then ss7.Text:=ss7.Text+'3'; if ab7[2] then ss7.Text:=ss7.Text+' 1'; if ab7[3] then ss7.Text:=ss7.Text+' 0'; if ab8[1] then ss8.Text:=ss8.Text+'3'; if ab8[2] then ss8.Text:=ss8.Text+' 1'; if ab8[3] then ss8.Text:=ss8.Text+' 0'; if ab9[1] then ss9.Text:=ss9.Text+'3'; if ab9[2] then ss9.Text:=ss9.Text+' 1'; if ab9[3] then ss9.Text:=ss9.Text+' 0'; if ab10[1] then ss10.Text:=ss10.Text+'3'; if ab10[2] then ss10.Text:=ss10.Text+' 1'; if ab10[3] then ss10.Text:=ss10.Text+' 0'; if ab11[1] then ss11.Text:=ss11.Text+'3'; if ab11[2] then ss11.Text:=ss11.Text+' 1'; if ab11[3] then ss11.Text:=ss11.Text+' 0'; if ab12[1] then ss12.Text:=ss12.Text+'3'; if ab12[2] then ss12.Text:=ss12.Text+' 1'; if ab12[3] then ss12.Text:=ss12.Text+' 0'; if ab13[1] then ss13.Text:=ss13.Text+'3'; if ab13[2] then ss13.Text:=ss13.Text+' 1'; if ab13[3] then ss13.Text:=ss13.Text+' 0'; if ab14[1] then ss14.Text:=ss14.Text+'3'; if ab14[2] then ss14.Text:=ss14.Text+' 1'; if ab14[3] then ss14.Text:=ss14.Text+' 0'; closefile(a); end;end;procedure TForm1.Button2Click(Sender: TObject);var IniFile:TIniFile; NewString:String;begin if InputQuery('500Wan','场名:',NewString) then begin s:=NewString; IniFile:=TIniFile.Create(Directory+'/Temp.ini'); try IniFile.WriteString('500Wan','场名',NewString); finally IniFile.Free; end; end;end;procedure TForm1.FormCreate(Sender: TObject);var IniFile:TIniFile;begin Directory:=GetCurrentDir; if FileExists(Directory+'/Temp.ini') then begin IniFile:=TIniFile.Create(Directory+'/Temp.Ini'); Try s:=IniFile.ReadString('500Wan','场名',s); Finally IniFile.Free; end;//try end;end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);var IniFile:TIniFile;begin if Not FileExists(Directory+'/Temp.ini') then begin IniFile:=TIniFile.Create(Directory+'/Temp.Ini'); Try IniFile.WriteString('500Wan','场名','第一场;第二场;第三场;第四场;第五场;第六场;第七场;第八场;'+ '第九场;第十场;第十一场;第十二场;第十三场;第十四场;'); Finally IniFile.Free; end;//try end else begin IniFile:=TIniFile.Create(Directory+'/Temp.ini'); try IniFile.WriteString('500Wan','场名',s); finally IniFile.Free; end; end;end;procedure TForm1.Button3Click(Sender: TObject);var a:TextFile; TempS:String; i:integer; // a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14:String;begin if OpenDialog1.FileName<>'' then begin AssignFile(a,OpenDialog1.FileName); try Reset(a); i:=1; ListBox1.Clear; while not eof(a) do begin readln(a,TempS); {a1:=GetNum(TempS,1); a2:=GetNum(TempS,2); a3:=GetNum(TempS,3); a4:=GetNum(TempS,4); a5:=GetNum(TempS,5); a6:=GetNum(TempS,6); a7:=GetNum(TempS,7); a8:=GetNum(TempS,8); a9:=GetNum(TempS,9); a10:=GetNum(TempS,10); a11:=GetNum(TempS,11);a12:=GetNum(TempS,12); a13:=GetNum(TempS,13); a14:=GetNum(TempS,14);} if ((F1.Text=GetNum(TempS,1)) or (F1.Text='#') or (F1.Text='')) then if ((F2.Text=GetNum(TempS,2)) or (F2.Text='#') or (F2.Text='')) then if ((F3.Text=GetNum(TempS,3)) or (F3.Text='#') or (F3.Text='')) then if ((F4.Text=GetNum(TempS,4)) or (F4.Text='#') or (F4.Text='')) then if ((F5.Text=GetNum(TempS,5)) or (F5.Text='#') or (F5.Text='')) then if ((F6.Text=GetNum(TempS,6)) or (F6.Text='#') or (F6.Text='')) then if ((F7.Text=GetNum(TempS,7)) or (F7.Text='#') or (F7.Text='')) then if ((F8.Text=GetNum(TempS,8)) or (F8.Text='#') or (F8.Text='')) then if ((F9.Text=GetNum(TempS,9)) or (F9.Text='#') or (F9.Text='')) then if ((F10.Text=GetNum(TempS,10)) or (F10.Text='#') or (F10.Text='')) then if ((F11.Text=GetNum(TempS,11)) or (F11.Text='#') or (F11.Text='')) then if ((F12.Text=GetNum(TempS,12)) or (F12.Text='#') or (F12.Text='')) then if ((F13.Text=GetNum(TempS,13)) or (F13.Text='#') or (F13.Text='')) then if ((F14.Text=GetNum(TempS,14)) or (F14.Text='#') or (F14.Text='')) then begin {With ListView1.Items.Add do begin Caption:=IntToStr(i); SubItems.Add(a1); SubItems.Add(a2); SubItems.Add(a3); SubItems.Add(a4); SubItems.Add(a5); SubItems.Add(a6); SubItems.Add(a7); SubItems.Add(a8); SubItems.Add(a9); SubItems.Add(a10); SubItems.Add(a11); SubItems.Add(a12); SubItems.Add(a13); SubItems.Add(a14); end;} if i<=9 then ListBox1.Items.Add(' 第 '+IntToStr(i)+' 注: '+Temps) else if i<=99 then ListBox1.Items.Add(' 第 '+IntToStr(i)+' 注: '+Temps) else if i<=999 then ListBox1.Items.Add(' 第 '+IntToStr(i)+' 注: '+Temps) else if i<=9999 then ListBox1.Items.Add(' 第 '+IntToStr(i)+' 注: '+Temps) else if i<=99999 then ListBox1.Items.Add(' 第 '+IntToStr(i)+' 注: '+Temps) else if i<=999999 then ListBox1.Items.Add(' 第 '+IntToStr(i)+'注: '+Temps); inc(i); end; end; finally closefile(a); end; end;end;procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin if Key=#13 then Button3Click(Sender);end;procedure TForm1.F1Enter(Sender: TObject);begin F1.SelectAll;end;procedure TForm1.F2Enter(Sender: TObject);begin F2.SelectAll;end;procedure TForm1.F3Enter(Sender: TObject);begin F3.SelectAll;end;procedure TForm1.F4Enter(Sender: TObject);begin F4.SelectAll;end;procedure TForm1.F5Enter(Sender: TObject);begin F5.SelectAll;end;procedure TForm1.F6Enter(Sender: TObject);begin F6.SelectAll;end;procedure TForm1.F7Enter(Sender: TObject);beginF7.SelectAll;end;procedure TForm1.F8Enter(Sender: TObject);beginF8.SelectAll;end;procedure TForm1.F9Enter(Sender: TObject);beginF9.SelectAll;end;procedure TForm1.F10Enter(Sender: TObject);beginF10.SelectAll;end;procedure TForm1.F11Enter(Sender: TObject);beginF11.SelectAll;end;procedure TForm1.F12Enter(Sender: TObject);beginF12.SelectAll;end;procedure TForm1.F13Enter(Sender: TObject);beginF13.SelectAll;end;procedure TForm1.F14Enter(Sender: TObject);beginF13.SelectAll;end;procedure TForm1.Button4Click(Sender: TObject);var a:TextFile; Temps,s:string; T_Array:Array of Array of Byte; //0=>>MAX,1=>>Min; T1,T2,T3,t4:Byte; i,j,T_s:integer;Function Getnum(S:string;n:byte):String;begin Getnum:=Copy(S,n,1);end;begin if Caption='' then begin ShowMessage('无信息!'); Exit; end; SetLength(T_Array,4,2); T1:=0;T2:=0;T3:=0;T4:=0; AssignFile(a,Caption); Reset(a); if Not eof(a) then begin Readln(a,Temps); if Temps<>'' then begin for i:=1 to 14 do begin s:=Getnum(TempS,i); if (s<>'*') and (s<>'#') then begin T_s:=StrToInt(s); if T_s=3 then T1:=T1+1;; if T_s=1 then T2:=T2+1; if T_s=0 then T3:=T3+1; T4:=T4+T_s; end; end; T_Array[0,0]:=T1;T_Array[0,1]:=T1; T_Array[1,0]:=T2;T_Array[1,1]:=T2; T_Array[2,0]:=T3;T_Array[2,1]:=T3; T_Array[3,0]:=T4;T_Array[3,1]:=T4; end; end; while not eof(a) do begin readln(a,TempS); if TempS<>'' then begin T1:=0;T2:=0;T3:=0;T4:=0; for i:=1 to 14 do begin s:=Getnum(TempS,i); if (s<>'*') and (s<>'#') then begin T_s:=StrToInt(s); if T_s=3 then T1:=T1+1;; if T_s=1 then T2:=T2+1; if T_s=0 then T3:=T3+1; T4:=T4+T_s; end; end; if T_Array[0,0]<T1 then T_Array[0,0]:=T1; if T_Array[0,1]>T1 then T_Array[0,1]:=T1; if T_Array[1,0]<T2 then T_Array[1,0]:=T2; if T_Array[1,1]>T2 then T_Array[1,1]:=T2; if T_Array[2,0]<T3 then T_Array[2,0]:=T3; if T_Array[2,1]>T3 then T_Array[2,1]:=T3; if T_Array[3,0]<T4 then T_Array[3,0]:=T4; if T_Array[3,1]>T4 then T_Array[3,1]:=T4; end; end; Edit1.Text:=IntToStr(T_Array[0,1])+'---->'+IntToStr(T_Array[0,0]); Edit2.Text:=IntToStr(T_Array[1,1])+'---->'+IntToStr(T_Array[1,0]); Edit3.Text:=IntToStr(T_Array[2,1])+'---->'+IntToStr(T_Array[2,0]); Edit4.Text:=IntToStr(T_Array[3,1])+'--->'+IntToStr(T_Array[3,0]); closefile(a);end;很早之前自己写的一个足彩分析别人下单的规律.希望对你有帮助