水晶宫VS巴列卡诺直播_水晶宫VS巴列卡诺直播观看免费_水晶宫VS巴列卡诺

2026-06-08 12:28:24

水晶宫VS巴列卡诺直播_水晶宫VS巴列卡诺直播观看免费_水晶宫VS巴列卡诺

1 {/**

2

3 Date:2014-3-20

4

5 Author:吴chunyuan转载请注明出处

6

7 **/}

8

9 procedure TFxlcj.Caiji_xl(OperNum:integer); {本程序主要处理环节: 采集新浪数据 0-初始化 1-盘中 体球网采集:3-联赛球队 4-期数系列 }

10 var Rp_Count,Get_Web,LineCount,c,i,j,backStart,Count_ws ,Count_qx:integer;

11 ThreadId1:DWORD;

12 Ret_Get_bszl:TArr;

13 // Fmt :TCharFormat2;

14 begin

15 Get_Web:=1;

16 if Eqhao.Text='' then

17 begin

18 if OperNum<4 then

19 begin

20 SendtoMain('采集窗口提示:请输入期号如130808');

21 exit;

22 end;

23 end;

24

25 Csh_qpfx(OperNum); {初始化期号}

26 Edit2.CopyToClipboard; //将剪切板初始化

27 sleep(20);

28 RichEdit1.PlainText := true;

29 //WebBrowser1.SetFocus;

30

31

41 WebBrowser1.SetFocus;

42

43 Rp_Count:=0; {初始化重负复制网页的次数,因为有时复制不成功 上限20次}

44

45 Repeat {复制网页以提取数据}

46

47 try

48 webbrowser1.ExecWB(OLECMDID_SELECTALL,0);

49 webbrowser1.ExecWB(OLECMDID_COPY,0);

50 // WebBrowser1.ExecWB(OLECMDID_UNDO, 0);

51 Get_Web:=0;

52 except

53 SendtoMain('复制网页异常,请重来!');

54 Get_Web:=1;

55 end;

56

57 if Get_Web=0 then

58 begin

59 richedit1.Lines.Clear;

60 //richedit1.SetFocus;

61 richedit1.PasteFromClipboard;

62 WebBrowser1.ExecWB(OLECMDID_UNDO, OLECMDEXECOPT_DODEFAULT); //取消全选

63 c:=0; {寻找选择区域的起点位置}

64 // backStart := RichEdit1.SelStart; //备份光标位置

65 RichEdit1.SelStart := c; //寻找选择区域的起点位置

66 // initializeCriticalSection(CS); //没初始化会 提示访问ntdll.dll模块出错

67 LineCount:=RichEdit1.Lines.Count;

68 SendtoMain('采集失败,请重来!');

69 end;

70 Rp_Count:=Rp_Count+1;

71 until ((LineCount>100) or (Rp_Count>2) ); //重复不超2次

72

73 {

74

75 WebBrowser1.ExecWB(OLECMDID_SELECTALL, OLECMDEXECOPT_DODEFAULT); //全选网页

76 WebBrowser1.ExecWB(OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT); //复制网页

77 WordDocu.Range.Paste; //word文档粘贴

78 WebBrowser1.ExecWB(OLECMDID_UNDO, OLECMDEXECOPT_DODEFAULT); //取消全选

79 }

80

81 if Rp_Count>20 then exit;

82 清水鼓动比赛前瞻

83 {采集期数序列}

84

85 setlength(Ret_Get_bszl,18); {初始化数组}

86

87 if OperNum=4 then //取期号序列

88 begin

89 for i:=10 to 50 do

90 begin

91 Ret_Get_bszl:=Get_bszl(2,i);

92 if (Ret_Get_bszl[0]<>'1.0') and (length(Ret_Get_bszl[0])=6) then

93 begin

94 Eqhao.Text:=Ret_Get_bszl[0];

95 ComboBox2.Items.Clear;

96 for j:=0 to 9 do

97 ComboBox2.Items.Add(Ret_Get_bszl[j]);

98 ComBobox2.ItemIndex:=0;

99 //Memo1.Lines.Clear;

100 SendtoMain('取期号序列成功:');

101 SendtoMain(Ret_Get_bszl[0]+' '+Ret_Get_bszl[1]+' '+Ret_Get_bszl[2]+' '+Ret_Get_bszl[3]+' '+Ret_Get_bszl[4]+' '+Ret_Get_bszl[5]+' '+Ret_Get_bszl[6]+' '+Ret_Get_bszl[7]+' '+Ret_Get_bszl[8]+' '+ Ret_Get_bszl[9]);

102 exit;

103 end;

104 end;

105 end;

106

107 {开始采集数据}

108 if OperNum<4 then

109 begin

110 if OperNum=0 then

111 SendtoMain('初始化采集中....') else

112 SendtoMain('盘中采集中....');

113 Count_ws:=0; //未赛场数

114 Count_qx:=0;

115 for i:=0 to LineCount-1 do

116 begin

117

118 j:=Caiji_xl_cjoneline(OperNum,i);

119 if j=0 then Count_ws:=Count_ws+1;

120 if j=2 then Count_qx:=Count_qx+1;

121 sleep(5);

122 application.ProcessMessages; //使用简单多线程

123

124 end;

125 if Count_ws>0 then

126 SendtoMain('采集完毕,未赛场数:'+inttostr(Count_ws-1)+',取消场数:'+inttostr(Count_qx)) else

127 SendtoMain('采集失败!');

128

129

130

131 end;

132

133 RichEdit1.SelStart := backStart ; //恢复光标位置

134 //webbrowser1.SetFocus;

135 // WebBrowser1.ExecWB(OLECMDID_UNDO,0); // OLECMDEXECOPT_DODEFAULT

136 end;

137

138 主要过程、函数:(贴两个好了。。)

139

140 function TFxlcj.Caiji_xl_cjoneline(OperNum:integer;Num:integer):integer; //返回 0- 无比分 1-有比分 2-取消 3-其他

141 var rs,i:integer;

142 Ret_Get_bszl,sparr:TArr;

143 fMainMessage,s,strpk,strbf,strypoz,strypsp:string;

144 begin

145 // EnterCriticalSection(CS);

146 rs:=3;

147 setlength(Ret_Get_bszl,18);

148 i:=Num;

149 Ret_Get_bszl:= Get_bszl(1,i); {取每条比赛记录,返回个字段值}

150

151

155

156 if i>=130 then //从网页131行开始取比赛资料

157 begin

158 if length(Ret_Get_bszl[1])=1 then {是比赛记录 将进行:取数-插入bslsz }

159 begin

160 g_IfInsert:=IfInsert_bslsz(Ret_Get_bszl[0],Ret_Get_bszl[3],Ret_Get_bszl[5]);

161 if g_IfInsert<0 then exit;

162

163 if Ret_Get_bszl[9]<>'' then {无比分}

164 begin

165 rs:=0;

166 //SendtoMain(strdate+','+str2+','+str3+','+str4+','+str5+','+str6+','+str7+','+str81+','+str82+','+str83+','+str10+','+str11+','+str12);

167 try

168 if g_IfInsert=0 then

169 s := Format('insert into bslsz (bsrq,xh,bssj,lsmc,zd,rangqiu,kd,sp1,sp2,sp3,xsp1,xsp2,xsp3,qhao) values (%s,%d,%s,%s,%s,%d,%s,%f,%f,%f,%f,%f,%f,%s)',

170 ['#'+Ret_Get_bszl[0]+'#',strtoint(Ret_Get_bszl[2]),quotedstr(Ret_Get_bszl[4]),quotedStr(Ret_Get_bszl[3]),quotedStr(Ret_Get_bszl[5]),strtoint(Ret_Get_bszl[6]),quotedStr(Ret_Get_bszl[7]),strtofloat(Ret_Get_bszl[8]),strtofloat(Ret_Get_bszl[9]),strtofloat(Ret_Get_bszl[10]),strtofloat(Ret_Get_bszl[14]),strtofloat(Ret_Get_bszl[15]),strtofloat(Ret_Get_bszl[16]),Quotedstr(Eqhao.Text)]);

171 g_insertflag:=1;

172

173 except

174 //exit;

175 g_insertflag:=0;

176 SendtoMain('无SP');

177 end;

178

179 if ( (g_IfInsert>0) and (OperNum=0)) or (OperNum=1) then {无比分,更新最新xsp--重新初始化 }

180 Update_sp(Ret_Get_bszl[0],Ret_Get_bszl[3],Ret_Get_bszl[5],Ret_Get_bszl[8],Ret_Get_bszl[9],Ret_Get_bszl[10],Ret_Get_bszl[14],Ret_Get_bszl[15],Ret_Get_bszl[16],OperNum); {修改xsp1,xsp2,xsp3}

181

182 {OperNum=1 无比分,更新最新xsp--盘中 }

183 {修改xsp1,xsp2,xsp3}

184 end;

185

186

187 if Ret_Get_bszl[9]='' then {有比分}

188 begin

189 rs:=1;

190 try

191 strpk:= Return_pank(strtoint(Ret_Get_bszl[6]),strtoint(Ret_Get_bszl[8]),strtoint(Ret_Get_bszl[10]));

192 strbf:= Return_bf(strtoint(Ret_Get_bszl[8]),strtoint(Ret_Get_bszl[10]));

193 except

194 SendtoMain('errcode:2,'+Ret_Get_bszl[5]);

195 exit;

196 end;

197

198 //SendtoMain(Ret_Get_bszl[0]+','+Ret_Get_bszl[2]+','+Ret_Get_bszl[3]+','+Ret_Get_bszl[4]+','+Ret_Get_bszl[5]+','+Ret_Get_bszl[6]+','+Ret_Get_bszl[7]+','+Ret_Get_bszl[8]+':'+Ret_Get_bszl[10]+','+Ret_Get_bszl[11]+','+Ret_Get_bszl[12]+','+Ret_Get_bszl[13]+','+Ret_Get_bszl[14]+','+Ret_Get_bszl[15]+','+Ret_Get_bszl[16]+strpk+','+strbf);

199 fMainMessage:=Ret_Get_bszl[2]+' '+Ret_Get_bszl[3]+' '+Ret_Get_bszl[5]+'--'+Ret_Get_bszl[7]+' '+Ret_Get_bszl[8]+':'+Ret_Get_bszl[10]+' '+strpk+','+strbf;

200 SendtoMain(fMainMessage);

201 if g_IfInsert=0 then

202 try

203

204 s := Format('insert into bslsz (bsrq,xh,bssj,lsmc,zd,rangqiu,kd,zdrq,kdrq,sp1,sp2,sp3,xsp1,xsp2,xsp3,pjg,bfjg,qhao) values (%s,%d,%s,%s,%s,%d,%s,%d,%d,%f,%f,%f,%f,%f,%f,%s,%s,%s)',

205 ['#'+Ret_Get_bszl[0]+'#',strtoint(Ret_Get_bszl[2]),quotedstr(Ret_Get_bszl[4]),quotedStr(Ret_Get_bszl[3]),quotedStr(Ret_Get_bszl[5]),strtoint(Ret_Get_bszl[6]),quotedStr(Ret_Get_bszl[7]),strtoint(Ret_Get_bszl[8]),strtoint(Ret_Get_bszl[10]),strtofloat(Ret_Get_bszl[11]),strtofloat(Ret_Get_bszl[12]),strtofloat(Ret_Get_bszl[13]),strtofloat(Ret_Get_bszl[14]),strtofloat(Ret_Get_bszl[15]),strtofloat(Ret_Get_bszl[16]),quotedStr(strpk),quotedStr(strbf),Quotedstr(Eqhao.Text)]);

206

207 except

208 showmessage('e:'+s);

209 exit;

210 end;

211

212 if g_IfInsert>0 then

213 begin

214 setlength(sparr,13);

215 sparr:=Bslsz_sp(Ret_Get_bszl[0],Ret_Get_bszl[3],Ret_Get_bszl[5]); { sp1,nsp1,sp2,nsp2,sp3,nsp3,xsp1,nxsp1,xsp2,nxsp2,xsp3,nxsp3}

216 //SendtoMain(sparr[0]);

217 if strpk='赢' then {取最新SP 如果数据库最新 sp 或欧指为-1.0 取网页最新值 2013-7-30 }

218 begin strypoz:=Ret_Get_bszl[11]; strypsp:=Ret_Get_bszl[14]; end;

219

220

221 if strpk='平' then

222 begin strypoz:=Ret_Get_bszl[12]; strypsp:=Ret_Get_bszl[15]; end;

223

224 if strpk='负' then

225 begin strypoz:=Ret_Get_bszl[13]; strypsp:=Ret_Get_bszl[16]; end;

226

227 if strpk='取消' then

228 begin rs:=2;strypoz:='-1.0'; strypsp:='-1.0'; end; {2013-11-4增加,否则Update_bslsz 无数据,出错}

229

230

231 try

232 Update_bslsz(Ret_Get_bszl[0],Ret_Get_bszl[3],Ret_Get_bszl[5],strtoint(Ret_Get_bszl[8]),strtoint(Ret_Get_bszl[10]),strpk,strbf,strypsp,strypoz);

233 except

234 SendtoMain('errcode:update_bslsz'+strypsp+','+strypoz);

235 exit;

236 end;

237 end;

238 end;

239

240 if g_IfInsert=0 then

241 Insert_bslsz(s);

242 end;{插入结束}

243 // RichEdit1.SelLength := 0; //恢复选择

244

245 end;

246 result:=rs;

247 // LeaveCriticalSection(CS);

248 end;

249

250

251

252

253 Function TFxlcj.Get_bszl(Flag:Integer;Row:Integer):TArr; {取每行比赛资料,Flag=1比赛资料 2-取期序列}

254 var

255 str1,str2,str3,str4,str5,str6,str7,str8,str81,str82,str83,str9,str91,str92,str93,str10,str11,str12:string;

256 pos1:integer;

257 begin

258

259 str82:='';

260 RichEdit1.SelLength := length(richedit1.Lines.Strings[Row]); //获得选择当前行的长度

261 str1:= GetFieldValue(' ',richedit1.Lines.Strings[Row],1);

262 str2:= GetFieldValue(' ',richedit1.Lines.Strings[Row],2);

263 if Flag=2 then {取期数系列}

264 begin

265

266 // SendtoMain(str1+','+str2);

267

268 Result[0]:='1.0';

269 Result[1]:='1.0';

270 Result[2]:='1.0';

271 Result[3]:='1.0';

272 Result[4]:='1.0';

273 Result[5]:='1.0';

274 Result[6]:='1.0';

275 Result[7]:='1.0';

276 Result[8]:='1.0';

277 Result[9]:='1.0';

278 Result[10]:='1.0';

279 Result[11]:='1.0';

280 Result[12]:='1.0';

281 Result[13]:='1.0';

282 Result[14]:='1.0';

283 Result[15]:='1.0';

284 Result[16]:='1.0';

285 if copy(str2,1,4)='当前' then

286 begin

287 Result[0]:=str1;

288 Result[1]:=copy(str2,5,6);

289 Result[2]:=copy(str2,11,6);

290 Result[3]:=copy(str2,17,6);

291 Result[4]:=copy(str2,23,6);

292 Result[5]:=copy(str2,29,6);

293 Result[6]:=copy(str2,35,6);

294 Result[7]:=copy(str2,41,6);

295 Result[8]:=copy(str2,47,6);

296 Result[9]:=copy(str2,53,6);

297

298 end;

299 exit;

300 end;

301

302

303 str3:= GetFieldValue(' ',richedit1.Lines.Strings[Row],3);

304 str4:= GetFieldValue(' ',richedit1.Lines.Strings[Row],4);

305 str5:= GetFieldValue(' ',richedit1.Lines.Strings[Row],5);

306 pos1:=pos('(',str5); {去除主队(中)}

307 if pos1>0 then str5:=copy(str5,1,pos1-1);

308 str6:= GetFieldValue(' ',richedit1.Lines.Strings[Row],6);

309 str7:= GetFieldValue(' ',richedit1.Lines.Strings[Row],7);

310 str8:= GetFieldValue(' ',richedit1.Lines.Strings[Row],8);

311 pos1:=pos('-',str8);

312

313 if pos1>0 then {未有比分,无欧指}

314 begin

315 str81:='-1.0';

316 str82:='-1.0';

317 str83:='-1.0';

318 end;

319 {begin 根据str8长度判断 =12 ; >12 ; <12且 <>'---' ; }

320

321 if length(str8)=12 then {有大于12的情况 :1.192.1912.19}

322 begin

323 str81:=copy(str8,1,4);

324 str82:=copy(str8,5,4);

325 str83:=copy(str8,9,4);

326 end;

327

328 if str8='---' then

329 begin

330 str81:='-1.0';

331 str82:='-1.0';

332 str83:='-1.0';

333 end;

334

335

336 if (length(str8)>12) then {有大于12的情况 :1.19 2.19 12.19}

337 begin

338 if (length(GetFieldValue('.',str8,1))=1) and (length(GetFieldValue('.',str8,2))=3) and (length(GetFieldValue('.',str8,3))=4) then

339 begin

340 str81:=copy(str8,1,4);

341 str82:=copy(str8,5,4);

342 str83:=copy(str8,9,5);

343 end;

344 {12.11 1.23 3.23}

345 if (length(GetFieldValue('.',str8,1))=2) and (length(GetFieldValue('.',str8,2))=3) and (length(GetFieldValue('.',str8,3))=3) then

346 begin

347 str81:=copy(str8,1,5);

348 str82:=copy(str8,6,4);

349 str83:=copy(str8,10,4);

350 end;

351

352 {12.11 11.23 3.23}

353 if (length(GetFieldValue('.',str8,1))=2) and (length(GetFieldValue('.',str8,2))=4) and (length(GetFieldValue('.',str8,3))=3) then

354 begin

355 str81:=copy(str8,1,5);

356 str82:=copy(str8,6,5);

357 str83:=copy(str8,11,4);

358 end;

359

360

361 {1.11 21.23 3.23}

362 if (length(GetFieldValue('.',str8,1))=1) and (length(GetFieldValue('.',str8,2))=4) and (length(GetFieldValue('.',str8,3))=3) then

363 begin

364 str81:=copy(str8,1,4);

365 str82:=copy(str8,5,5);

366 str83:=copy(str8,10,4);

367 end;

368

369 {1.11 21.23 13.23}

370 if (length(GetFieldValue('.',str8,1))=1) and (length(GetFieldValue('.',str8,2))=4) and (length(GetFieldValue('.',str8,3))=4) then

371 begin

372 str81:=copy(str8,1,4);

373 str82:=copy(str8,5,5);

374 str83:=copy(str8,10,5);

375 end;

376

377

378

379

380 end;

381

382

383 if (length(str8)<12) and (trim(str8)<>'---') then {有比分 如果* -腰斩不取}

384 begin

385 str81:= GetFieldValue(':',str8,1);

386 str82:=''; { str82='' 无比分的标志}

387 str83:= GetFieldValue(':',str8,2);

388 if trim(str8)='*' then

389 begin

390 str81:='-1';

391 str83:='-1';

392 end;

393

394 end;

395

396 {end 根据str8长度判断 =12 ; >12 ; <12且 <>'---' ; }

397

398 str9:= GetFieldValue(' ',richedit1.Lines.Strings[Row],9) ; {SP}

399 {begin 根据str9长度判断 =12 ; >12 }

400 if length(str9)=12 then

401 begin

402 str91:=copy(str9,1,4);

403 str92:=copy(str9,5,4);

404 str93:=copy(str9,9,4);

405 end;

406

407 if length(str9)>12 then {有大于12的情况 :1.192.1912.19}

408 begin

409 if (length(GetFieldValue('.',str9,1))=1) and (length(GetFieldValue('.',str9,2))=3) and (length(GetFieldValue('.',str9,3))=4) then

410 begin

411 str91:=copy(str9,1,4);

412 str92:=copy(str9,5,4);

413 str93:=copy(str9,9,5);

414 end;

415 {12.111.233.23}

416 if (length(GetFieldValue('.',str9,1))=2) and (length(GetFieldValue('.',str9,2))=3) and (length(GetFieldValue('.',str9,3))=3) then

417 begin

418 str91:=copy(str9,1,5);

419 str92:=copy(str9,6,4);

420 str93:=copy(str9,10,4);

421 end;

422

423 {1.1121.233.23}

424 if (length(GetFieldValue('.',str9,1))=1) and (length(GetFieldValue('.',str9,2))=4) and (length(GetFieldValue('.',str9,3))=3) then

425 begin

426 str91:=copy(str9,1,4);

427 str92:=copy(str9,5,5);

428 str93:=copy(str9,10,4);

429 end;

430

431 end;

432 {end根据str9长度判断 =12 ; >12 }

433

434 {begin 以下取 str10,str11,str12 ,str91,str,92,str93}

435 if length(str9)>=12 then {有比分时的nsp}

436 begin

437 str10:= GetFieldValue(' ',richedit1.Lines.Strings[Row],11);

438 str11:= GetFieldValue(' ',richedit1.Lines.Strings[Row],12);

439 str12:= GetFieldValue(' ',richedit1.Lines.Strings[Row],13);

440 if length(str10)=1 then str10:='-1.0';

441 if length(str11)=1 then str11:='-1.0';

442 if length(str12)=1 then str12:='-1.0';

443 end;

444

445

446 if str9='---' then {有比分时无oz-20130814}

447 begin

448 str91:='-1.0';

449 str92:='-1.0';

450 str93:='-1.0';

451 str10:= GetFieldValue(' ',richedit1.Lines.Strings[Row],11);

452 str11:= GetFieldValue(' ',richedit1.Lines.Strings[Row],12);

453 str12:= GetFieldValue(' ',richedit1.Lines.Strings[Row],13);

454 if length(str10)=1 then str10:='-1.0';

455 if length(str11)=1 then str11:='-1.0';

456 if length(str12)=1 then str12:='-1.0';

457 end;

458

459 if length(str8)>=12 then {无比分nsp}

460 begin

461 str10:= GetFieldValue(' ',richedit1.Lines.Strings[Row],10);

462 str11:= GetFieldValue(' ',richedit1.Lines.Strings[Row],11);

463 str12:= GetFieldValue(' ',richedit1.Lines.Strings[Row],12);

464 if trim(str10)='-' then str10:='-1.0' ;

465 if trim(str11)='-' then str11:='-1.0' ;

466 if trim(str12)='-' then str12:='-1.0' ;

467 end;

468 {end 取 str10,str11,str12 ,str91,str,92,str93}

469

470 if length(str1)>4 then{取比赛日期}

471 g_strdate:=str1;

472

473 {返回各字段到TArr }

474 Result[0]:=g_strdate;

475 Result[1]:=str1;

476 Result[2]:=str2;

477 Result[3]:=str3;

478 Result[4]:=str4;

479 Result[5]:=str5;

480 Result[6]:=str6;

481 Result[7]:=str7;

482 Result[8]:=str81;

483 Result[9]:=str82;

484 Result[10]:=str83;

485 Result[11]:=str91;

486 Result[12]:=str92;

487 Result[13]:=str93;

488 Result[14]:=str10;

489 Result[15]:=str11;

490 Result[16]:=str12;

491

492 if Result[11]='' then Result[11]:='1.0';

493 if Result[12]='' then Result[12]:='1.0';

494 if Result[13]='' then Result[13]:='1.0';

495 if Result[14]='' then Result[14]:='1.0';

496 if Result[15]='' then Result[15]:='1.0';

497 if Result[16]='' then Result[16]:='1.0';

498

499 end;

500

501 function TFxlcj.Caiji_xl_cjoneline(OperNum:integer;Num:integer):integer; //返回 0- 无比分 1-有比分 2-取消 3-其他

502 var rs,i:integer;

503 Ret_Get_bszl,sparr:TArr;

504 fMainMessage,s,strpk,strbf,strypoz,strypsp:string;

505 begin

506 // EnterCriticalSection(CS);

507 rs:=3;

508 setlength(Ret_Get_bszl,18);

509 i:=Num;

510 Ret_Get_bszl:= Get_bszl(1,i); {取每条比赛记录,返回个字段值}

511

512

516

517 if i>=130 then //从网页131行开始取比赛资料

518 begin

519 if length(Ret_Get_bszl[1])=1 then {是比赛记录 将进行:取数-插入bslsz }

520 begin

521 g_IfInsert:=IfInsert_bslsz(Ret_Get_bszl[0],Ret_Get_bszl[3],Ret_Get_bszl[5]);

522 if g_IfInsert<0 then exit;

523

524 if Ret_Get_bszl[9]<>'' then {无比分}

525 begin

526 rs:=0;

527 //SendtoMain(strdate+','+str2+','+str3+','+str4+','+str5+','+str6+','+str7+','+str81+','+str82+','+str83+','+str10+','+str11+','+str12);

528 try

529 if g_IfInsert=0 then

530 s := Format('insert into bslsz (bsrq,xh,bssj,lsmc,zd,rangqiu,kd,sp1,sp2,sp3,xsp1,xsp2,xsp3,qhao) values (%s,%d,%s,%s,%s,%d,%s,%f,%f,%f,%f,%f,%f,%s)',

531 ['#'+Ret_Get_bszl[0]+'#',strtoint(Ret_Get_bszl[2]),quotedstr(Ret_Get_bszl[4]),quotedStr(Ret_Get_bszl[3]),quotedStr(Ret_Get_bszl[5]),strtoint(Ret_Get_bszl[6]),quotedStr(Ret_Get_bszl[7]),strtofloat(Ret_Get_bszl[8]),strtofloat(Ret_Get_bszl[9]),strtofloat(Ret_Get_bszl[10]),strtofloat(Ret_Get_bszl[14]),strtofloat(Ret_Get_bszl[15]),strtofloat(Ret_Get_bszl[16]),Quotedstr(Eqhao.Text)]);

532 g_insertflag:=1;

533

534 except

535 //exit;

536 g_insertflag:=0;

537 SendtoMain('无SP');

538 end;

539

540 if ( (g_IfInsert>0) and (OperNum=0)) or (OperNum=1) then {无比分,更新最新xsp--重新初始化 }

541 Update_sp(Ret_Get_bszl[0],Ret_Get_bszl[3],Ret_Get_bszl[5],Ret_Get_bszl[8],Ret_Get_bszl[9],Ret_Get_bszl[10],Ret_Get_bszl[14],Ret_Get_bszl[15],Ret_Get_bszl[16],OperNum); {修改xsp1,xsp2,xsp3}

542

543 {OperNum=1 无比分,更新最新xsp--盘中 }

544 {修改xsp1,xsp2,xsp3}

545 end;

546

547

548 if Ret_Get_bszl[9]='' then {有比分}

549 begin

550 rs:=1;

551 try

552 strpk:= Return_pank(strtoint(Ret_Get_bszl[6]),strtoint(Ret_Get_bszl[8]),strtoint(Ret_Get_bszl[10]));

553 strbf:= Return_bf(strtoint(Ret_Get_bszl[8]),strtoint(Ret_Get_bszl[10]));

554 except

555 SendtoMain('errcode:2,'+Ret_Get_bszl[5]);

556 exit;

557 end;

558

559 //SendtoMain(Ret_Get_bszl[0]+','+Ret_Get_bszl[2]+','+Ret_Get_bszl[3]+','+Ret_Get_bszl[4]+','+Ret_Get_bszl[5]+','+Ret_Get_bszl[6]+','+Ret_Get_bszl[7]+','+Ret_Get_bszl[8]+':'+Ret_Get_bszl[10]+','+Ret_Get_bszl[11]+','+Ret_Get_bszl[12]+','+Ret_Get_bszl[13]+','+Ret_Get_bszl[14]+','+Ret_Get_bszl[15]+','+Ret_Get_bszl[16]+strpk+','+strbf);

560 fMainMessage:=Ret_Get_bszl[2]+' '+Ret_Get_bszl[3]+' '+Ret_Get_bszl[5]+'--'+Ret_Get_bszl[7]+' '+Ret_Get_bszl[8]+':'+Ret_Get_bszl[10]+' '+strpk+','+strbf;

561 SendtoMain(fMainMessage);

562 if g_IfInsert=0 then

563 try

564

565 s := Format('insert into bslsz (bsrq,xh,bssj,lsmc,zd,rangqiu,kd,zdrq,kdrq,sp1,sp2,sp3,xsp1,xsp2,xsp3,pjg,bfjg,qhao) values (%s,%d,%s,%s,%s,%d,%s,%d,%d,%f,%f,%f,%f,%f,%f,%s,%s,%s)',

566 ['#'+Ret_Get_bszl[0]+'#',strtoint(Ret_Get_bszl[2]),quotedstr(Ret_Get_bszl[4]),quotedStr(Ret_Get_bszl[3]),quotedStr(Ret_Get_bszl[5]),strtoint(Ret_Get_bszl[6]),quotedStr(Ret_Get_bszl[7]),strtoint(Ret_Get_bszl[8]),strtoint(Ret_Get_bszl[10]),strtofloat(Ret_Get_bszl[11]),strtofloat(Ret_Get_bszl[12]),strtofloat(Ret_Get_bszl[13]),strtofloat(Ret_Get_bszl[14]),strtofloat(Ret_Get_bszl[15]),strtofloat(Ret_Get_bszl[16]),quotedStr(strpk),quotedStr(strbf),Quotedstr(Eqhao.Text)]);

567

568 except

569 showmessage('e:'+s);

570 exit;

571 end;

572

573 if g_IfInsert>0 then

574 begin

575 setlength(sparr,13);

576 sparr:=Bslsz_sp(Ret_Get_bszl[0],Ret_Get_bszl[3],Ret_Get_bszl[5]); { sp1,nsp1,sp2,nsp2,sp3,nsp3,xsp1,nxsp1,xsp2,nxsp2,xsp3,nxsp3}

577 //SendtoMain(sparr[0]);

578 if strpk='赢' then {取最新SP 如果数据库最新 sp 或欧指为-1.0 取网页最新值 2013-7-30 }

579 begin strypoz:=Ret_Get_bszl[11]; strypsp:=Ret_Get_bszl[14]; end;

580

581

582 if strpk='平' then

583 begin strypoz:=Ret_Get_bszl[12]; strypsp:=Ret_Get_bszl[15]; end;

584

585 if strpk='负' then

586 begin strypoz:=Ret_Get_bszl[13]; strypsp:=Ret_Get_bszl[16]; end;

587

588 if strpk='取消' then

589 begin rs:=2;strypoz:='-1.0'; strypsp:='-1.0'; end; {2013-11-4增加,否则Update_bslsz 无数据,出错}

590

591

592 try

593 Update_bslsz(Ret_Get_bszl[0],Ret_Get_bszl[3],Ret_Get_bszl[5],strtoint(Ret_Get_bszl[8]),strtoint(Ret_Get_bszl[10]),strpk,strbf,strypsp,strypoz);

594 except

595 SendtoMain('errcode:update_bslsz'+strypsp+','+strypoz);

596 exit;

597 end;

598 end;

599 end;

600

601 if g_IfInsert=0 then

602 Insert_bslsz(s);

603 end;{插入结束}

604 // RichEdit1.SelLength := 0; //恢复选择

605

606 end;

607 result:=rs;

608 // LeaveCriticalSection(CS);

609 end;