2012年3月10日
摘要: //TStringList 常用方法与属性:varList: TStringList;i: Integer;beginList := TStringList.Create;List.Add('Strings1'); {添加}List.Add('Strings2');List.Exchange(0,1); {置换}List.Insert(0,'Strings3'); {插入}i := List.IndexOf('Strings1'); {第一次出现的位置}List.Sort; {排序}List.Sorted := True; {指定 阅读全文
posted @ 2012-03-10 16:09 为人民服务 阅读(247) 评论(0) 推荐(0) 编辑
摘要: unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls, ExtCtrls;typeTForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton; procedure Button1Click(Sender: TObject); procedure Button2... 阅读全文
posted @ 2012-03-10 16:03 为人民服务 阅读(780) 评论(0) 推荐(0) 编辑
摘要: procedure TForm1.BitBtn1Click(Sender: TObject); var i,d,j:integer; editm:tedit; begin d:=0; j:=strtoint(num.text); for i:=1 to j do begin editm :=tedit.Create(self); with editm do begin editm.Parent:=Scroll... 阅读全文
posted @ 2012-03-10 15:59 为人民服务 阅读(1238) 评论(0) 推荐(0) 编辑
摘要: uses Tlhelp32; function KillTask(ExeFileName: string): integer;const PROCESS_TERMINATE = $0001;var ContinueLoop: BOOLean; FSnapshotHandle: THandle; FProcessEntry32: TProcessEntry32;begin Result := 0; FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); FProcessEntry32.dwSize :=... 阅读全文
posted @ 2012-03-10 15:55 为人民服务 阅读(355) 评论(0) 推荐(0) 编辑
摘要: procedure TForm1.Button1Click(Sender: TObject);var b: array of integer; num: Integer; //随机数的个数 i, temp: integer;begin num := 10; SetLength(b,num); for i := 1 to num DO b[i] := i; ListBox1.Clear; for i := 1 to num do begin temp := Random(num - i + 1) + 1; ListBox1.Items.Add(I... 阅读全文
posted @ 2012-03-10 15:49 为人民服务 阅读(1257) 评论(0) 推荐(0) 编辑
摘要: No.1 利用MaxInt常量12345begin Caption := Copy(Edit1.Text, 3, Length(Edit1.Text) - 3 + 1); //不建议//---- Caption := Copy(Edit1.Text, 3, MaxInt); //建议//嘻嘻,少计算一次end;No.2 临时SQL查询1234567891011begin QueryTemp.Close; QueryTemp.SQL.Text := 'Select SUM(金额) AS 合计 FROM 销售表'; QueryTemp.Open; //不建议//数据没有关闭造成资源 阅读全文
posted @ 2012-03-10 15:46 为人民服务 阅读(245) 评论(0) 推荐(0) 编辑