05 2009 档案
学习 SQL 语句 - Insert、Update、Delete
摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB;type TForm1 = class(TForm) DBGrid1: TDBGri... 阅读全文
posted @ 2009-05-28 23:10 万一 阅读(7597) 评论(25) 推荐(0)
学习 SQL 语句 - Select(9): 其他
摘要://只要前五条记录procedure TForm1.Button1Click(Sender: TObject);begin with ADODataSet1 do begin Close; CommandText := 'SELECT TOP 5 * FROM country'; Open; end;end;//去除重复procedure TForm1.Button2Click(Sender:... 阅读全文
posted @ 2009-05-28 18:42 万一 阅读(3401) 评论(9) 推荐(0)
学习 SQL 语句 - Select(8): 分组条件
摘要:代码文件://分组条件可以是 Whereprocedure TForm1.Button1Click(Sender: TObject);begin with ADODataSet1 do begin Close; CommandText := 'SELECT Continent, AVG(Area) AS 平均面积 ' + 'FROM country WHERE Continent="South ... 阅读全文
posted @ 2009-05-28 17:54 万一 阅读(3605) 评论(0) 推荐(0)
学习 SQL 语句 - Select(7): 分组统计之 Avg()、Sum()、Max()、Min()、Count()
摘要:Group By本来 Group By 也可以根据多个字段分组("," 隔开), 但这个例子只有 Continent 字段适合分组, 也只有 Area、Population 字段适合统计.本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, F... 阅读全文
posted @ 2009-05-28 16:43 万一 阅读(4089) 评论(0) 推荐(0)
学习 SQL 语句 - Select(6): 字段运算
摘要:本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB;type TForm1 = class(TForm) DBGr... 阅读全文
posted @ 2009-05-28 16:12 万一 阅读(4432) 评论(0) 推荐(0)
学习 SQL 语句 - Select(5): 字段别名
摘要:本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB;type TForm1 = class(TForm) DBGr... 阅读全文
posted @ 2009-05-28 15:23 万一 阅读(4681) 评论(0) 推荐(0)
学习 SQL 语句 - Select(4): 排序
摘要:Order By Asc|Desc本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB;type TForm1 = ... 阅读全文
posted @ 2009-05-28 14:39 万一 阅读(4803) 评论(2) 推荐(0)
学习 SQL 语句 - Select(3): 条件查询与模糊查询
摘要:Where 用来指定查询条件;Like 和 Not Like 来指定模糊条件;模糊条件中:_ 表示任一字符;% 表示任一字符串;[] 表示一个集合.本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdC... 阅读全文
posted @ 2009-05-28 13:03 万一 阅读(7873) 评论(3) 推荐(1)
学习 SQL 语句 - Select(2): 指定表中的字段
摘要://选择 country 表中的 Name 字段SELECT Name FROM country//选择 country 表中的 Name、Area 和 Population 字段SELECT Name,Area,Population FROM country{多个字段时, 字段名是用 "," 隔开的}本例效果图:代码文件:unit Unit1;interfaceuses Windows, Me... 阅读全文
posted @ 2009-05-28 01:51 万一 阅读(5589) 评论(4) 推荐(0)
学习 SQL 语句 - Select(1): 指定表
摘要://选择 country 表中的所有字段SELECT * FROM country{虽然 SQL 并不区分大小写, 但应习惯把关键字大写}本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,... 阅读全文
posted @ 2009-05-28 01:40 万一 阅读(6286) 评论(7) 推荐(1)
使用 TClientDataSet(1)
摘要:本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, DBGrids, DB, DBClient, StdCtrls, ExtCtrls;type TForm1 = class(TForm) P... 阅读全文
posted @ 2009-05-28 00:00 万一 阅读(10952) 评论(20) 推荐(0)
时间与相关类型(3): TFileTime、TSystemTime 及 DOS 时间
摘要://相关函数:SysUtils.DateTimeToFileDate();SysUtils.FileDateToDateTime();SysUtils.DateTimeToSystemTime();SysUtils.SystemTimeToDateTime();Windows.SystemTimeToFileTime();Windows.FileTimeToSystemTime();Windows... 阅读全文
posted @ 2009-05-22 22:54 万一 阅读(5385) 评论(1) 推荐(0)
时间与相关类型(2) - TDate、TTime、TTimeStamp
摘要://相关函数:SysUtils.DateTimeToTimeStamp();SysUtils.TimeStampToDateTime();SysUtils.TimeStampToMSecs();SysUtils.MSecsToTimeStamp();Windows.GetTickCount;Windows.GetCurrentTime; {GetCurrentTime 和 GetTickCount... 阅读全文
posted @ 2009-05-22 18:14 万一 阅读(5697) 评论(0) 推荐(0)
时间与相关类型(1) - TDateTime 与 Double
摘要://相关函数:SysUtils.FloatToDateTime();SysUtils.TryFloatToDateTime();在 System 单元定义有: TDateTime = type Double;看来 TDateTime 是一个 8 字节 64 位数据, 不过是 Double 的别名.{测试: TDateTime 就是一个 Double}var t: TDateTime; d: D... 阅读全文
posted @ 2009-05-22 10:57 万一 阅读(6315) 评论(5) 推荐(0)
时间与字符串
摘要:SysUtils.StrToDate();SysUtils.StrToDateDef();SysUtils.TryStrToDate();SysUtils.StrToTime();SysUtils.StrToTimeDef();SysUtils.TryStrToTime();SysUtils.StrToDateTime();SysUtils.StrToDateTimeDef();SysUtils.... 阅读全文
posted @ 2009-05-21 23:18 万一 阅读(4321) 评论(4) 推荐(0)
区域设置 ID (LCID) 表, 及获取方法
摘要:中国的区域设置 ID 是 2052, 如果经常打开微软软件的安装目录应该经常见到.获取很简单, 有现成的 API 函数: GetThreadLocale.begin ShowMessage(IntToStr(GetThreadLocale)); //2052end;区域设置 ID (LCID) 表 区域设置描述 简写 十六进制值 十进制值 南非荷兰语 af 0x0436 ... 阅读全文
posted @ 2009-05-21 22:16 万一 阅读(8739) 评论(0) 推荐(1)
Now、Date、Time、CurrentYear - 当前日期
摘要:SysUtils.Now;SysUtils.Date;SysUtils.Time;SysUtils.CurrentYear;unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm) ... 阅读全文
posted @ 2009-05-21 17:50 万一 阅读(4268) 评论(0) 推荐(0)
Yesterday、Today、Tomorrow - 昨天、今天、明天
摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end;var Form1: TForm1... 阅读全文
posted @ 2009-05-21 17:37 万一 阅读(4373) 评论(0) 推荐(0)
IsSameDay、IsToday - 判断是不是同一天、判断是不是今天
摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end;var For... 阅读全文
posted @ 2009-05-21 16:58 万一 阅读(6432) 评论(0) 推荐(0)
DateUtils.IsPM - 判断时间是否是下午
摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end;var For... 阅读全文
posted @ 2009-05-21 15:57 万一 阅读(2249) 评论(1) 推荐(1)
禁止用鼠标拖动窗口的大小 - 回复 "合肥的石头" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2009/05/15/1458017.html#1534170//方法一, 同 BorderStyle := bsSingle;unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, F... 阅读全文
posted @ 2009-05-21 15:50 万一 阅读(2928) 评论(9) 推荐(0)
图片的居中、拉伸与平铺 - 回复 "我是一只想飞的小小鸟" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/11/04/1326105.html#1533947本例效果图:代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtr... 阅读全文
posted @ 2009-05-21 12:27 万一 阅读(3753) 评论(20) 推荐(0)
IsLeapYear、IsInLeapYear - 是否是闰年
摘要:SysUtils.IsLeapYear();DateUtils.IsInLeapYear();unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) proce... 阅读全文
posted @ 2009-05-21 11:54 万一 阅读(2822) 评论(0) 推荐(0)
IsValidDateTime、IsValidDate、IsValidTime、IsValidDateDay ... 判断时间是否合法
摘要:DateUtils.IsValidDateTimeDateUtils.IsValidDateDateUtils.IsValidTimeDateUtils.IsValidDateDayDateUtils.IsValidDateWeekDateUtils.IsValidDateMonthWeek//可用下面几个过程抛出异常:DateUtils.InvalidDateDayErrorDateUtils.... 阅读全文
posted @ 2009-05-21 11:29 万一 阅读(4537) 评论(0) 推荐(0)
RecodeDateTime、RecodeDate、RecodeTime、RecodeYear ... 修改时间
摘要:DateUtils.RecodeDateTime();DateUtils.RecodeDate();DateUtils.RecodeTime();DateUtils.RecodeYear();DateUtils.RecodeMonth();DateUtils.RecodeDay();DateUtils.RecodeHour();DateUtils.RecodeMinute();DateUtils.... 阅读全文
posted @ 2009-05-21 11:06 万一 阅读(2453) 评论(0) 推荐(0)
DecodeDate、DecodeTime ... DecodeDateTime ... 分解时间
摘要:SysUtils.DecodeDate();SysUtils.DecodeDateFully();SysUtils.DecodeTime();DateUtils.DecodeDateTime();DateUtils.DecodeDateDay();DateUtils.DecodeDateWeek();DateUtils.DecodeDateMonthWeek();DateUtils.DecodeD... 阅读全文
posted @ 2009-05-21 10:37 万一 阅读(5850) 评论(0) 推荐(0)
EncodeDateTime ... TryEncodeDateTime ... 构建时间
摘要:SysUtils.EncodeDateTimeSysUtils.EncodeDateSysUtils.EncodeTimeDateUtils.EncodeDateDayDateUtils.EncodeDateMonthWeekDateUtils.EncodeDateTimeDateUtils.EncodeDateWeekDateUtils.EncodeDayOfWeekInMonthDateUti... 阅读全文
posted @ 2009-05-20 23:11 万一 阅读(3895) 评论(0) 推荐(0)
WithinPastYears、WithinPastMonths、WithinPastWeeks、WithinPastDays ... 判断两个时间差是否在一个指定范围内
摘要:DateUtils.WithinPastYears();DateUtils.WithinPastMonths();DateUtils.WithinPastWeeks();DateUtils.WithinPastDays();DateUtils.WithinPastHours();DateUtils.WithinPastMinutes();DateUtils.WithinPastSeconds();... 阅读全文
posted @ 2009-05-20 22:13 万一 阅读(2624) 评论(0) 推荐(0)
WeeksInAYear、WeeksInYear、DaysInAYear、DaysInAMonth、DaysInYear、DaysInMonth - 获取指定年月的周、日数
摘要:DateUtils.DaysInYear();DateUtils.DaysInMonth();DateUtils.DaysInAYear();DateUtils.DaysInAMonth();DateUtils.WeeksInYear();DateUtils.WeeksInAYear();unit Unit1;interfaceuses Windows, Messages, SysUtils, ... 阅读全文
posted @ 2009-05-20 17:53 万一 阅读(3993) 评论(0) 推荐(0)
StartOfAYear ... StartOfTheYear ... EndOfAYear ... EndOfTheYear ... 每年、月、周、日的开始与结束的时间
摘要:{参数是指定的年、月、周、日}DateUtils.StartOfAYear DateUtils.StartOfAMonthDateUtils.StartOfAWeek DateUtils.StartOfADay{参数是 TDateTime}DateUtils.StartOfTheYear DateUtils.StartOfTheMonthDateUtils.StartOfTheWeek DateU... 阅读全文
posted @ 2009-05-20 17:27 万一 阅读(4465) 评论(0) 推荐(0)
IncYear、IncMonth、IncWeek、IncDay、IncHour、IncMinute、IncSecond、IncMilliSecond - 增时
摘要:DateUtils.IncYear();DateUtils.IncMonth();DateUtils.IncWeek();DateUtils.IncDay();DateUtils.IncHour();DateUtils.IncMinute();DateUtils.IncSecond();DateUtils.IncMilliSecond();unit Unit1;interfaceuses Win... 阅读全文
posted @ 2009-05-20 16:48 万一 阅读(13463) 评论(0) 推荐(0)
YearsBetween、MonthsBetween ... YearSpan、MonthSpan ... 间隔时间
摘要:DateUtils.YearsBetween();DateUtils.MonthsBetween();DateUtils.WeeksBetween();DateUtils.DaysBetween();DateUtils.HoursBetween();DateUtils.MinutesBetween();DateUtils.SecondsBetween();DateUtils.MilliSecond... 阅读全文
posted @ 2009-05-20 12:55 万一 阅读(5846) 评论(0) 推荐(0)
MonthOfTheYear、WeekOfTheYear、WeekOfTheMonth、DayOfTheYear ... 相对时间
摘要:SysUtils.DayOfWeek();DateUtils.MonthOfTheYear();DateUtils.WeekOfTheYear();DateUtils.WeekOfTheMonth();DateUtils.NthDayOfWeek();DateUtils.DayOfTheYear();DateUtils.DayOfTheMonth();DateUtils.DayOfTheWeek(... 阅读全文
posted @ 2009-05-20 11:59 万一 阅读(5336) 评论(0) 推荐(0)
DateOf、TimeOf、YearOf、MonthOf、WeekOf、DayOf、HourOf、MinuteOf、SecondOf、MilliSecondOf - 提取时间成分
摘要:它们的参数都是一个 TDateTime, DateOf、TimeOf 分别提取日期与时间, 并返回 TDateTime 类型;YearOf、MonthOf、WeekOf、DayOf、HourOf、MinuteOf、SecondOf、MilliSecondOf 返回的都是 Word 类型.unit Unit1;interfaceuses Windows, Messages, SysUtils, V... 阅读全文
posted @ 2009-05-20 11:19 万一 阅读(4700) 评论(1) 推荐(0)
CompareDateTime、CompareDate、CompareTime、SameDateTime、SameDate、SameTime - 对比时间的函数
摘要:CompareDateTime、CompareDate、CompareTime 返回的是 -1、0、1;前者 = 后者: 返回 0;前者 后者: 返回 1;前者 SameDateTime、SameDate、SameTime 返回的是 True 和 False.unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Cla... 阅读全文
posted @ 2009-05-20 10:30 万一 阅读(5514) 评论(0) 推荐(0)
Classes-Function
摘要:Classes.ActivateClassGroupClasses.ActiveClassGroupClasses.AllocateHWndClasses.AncestorIsValidClasses.BeginGlobalLoadingClasses.BinToHexClasses.BoundsClasses.CheckSynchronizeClasses.ClassGroupOfClasses... 阅读全文
posted @ 2009-05-20 06:53 万一
StrUtils-Function
摘要:StrUtils.AnsiContainsStrStrUtils.AnsiContainsTextStrUtils.AnsiEndsStrStrUtils.AnsiEndsTextStrUtils.AnsiIndexStrStrUtils.AnsiIndexTextStrUtils.AnsiLeftStrStrUtils.AnsiMatchStrStrUtils.AnsiMatchTextStrU... 阅读全文
posted @ 2009-05-20 06:51 万一
Math-Function
摘要:Math.ArcCosMath.ArcCoshMath.ArcCotMath.ArcCotHMath.ArcCscMath.ArcCscHMath.ArcSecMath.ArcSecHMath.ArcSinMath.ArcSinhMath.ArcTan2Math.ArcTanhMath.CeilMath.ClearExceptionsMath.CompareValueMath.CosecantMa... 阅读全文
posted @ 2009-05-20 06:48 万一
DateUtils-Function
摘要:DateUtils.CompareDateDateUtils.CompareDateTimeDateUtils.CompareTimeDateUtils.DateOfDateUtils.DateTimeToJulianDateDateUtils.DateTimeToModifiedJulianDateDateUtils.DateTimeToUnixDateUtils.DayOfDateUtils.... 阅读全文
posted @ 2009-05-20 06:44 万一
SysUtils-Function
摘要:SysUtils.AbortSysUtils.AddExitProcSysUtils.AddTerminateProcSysUtils.AdjustLineBreaksSysUtils.AnsiCompareFileNameSysUtils.AnsiCompareStrSysUtils.AnsiCompareTextSysUtils.AnsiDequotedStrSysUtils.AnsiExtr... 阅读全文
posted @ 2009-05-20 06:39 万一
System-Function
摘要:System.AbsSystem.AcquireExceptionObjectSystem.AddModuleUnloadProcSystem.AddrSystem.AllocMemSystem.AnsiToUtf8System.AppendSystem.ArcTanSystem.AssertSystem.AssignedSystem.AssignFileSystem.AttemptToUseSh... 阅读全文
posted @ 2009-05-20 06:31 万一
博客导读(09.5.15)
摘要:Windows 编程 | Message | 多线程 | 内存管理 | 内存函数 | 钩子函数 | 初学汇编 | 算法与数据结构 | 复合文件 | 资源文件 | 光标相关函数 | WinAPI 字符及字符串函数 | 再学 GDI+ | 用 GDI 操作 EMF 文件 | Delphi 的绘图功能 | 理解类 | TStringGrid | TMainMenu | TTreeView | TScreen | TRegistry | TListView | 使用剪切板 | TList 类的实现 | 运算符重载 | 编译指令 | 字符及字符串 | 关键字详解 | 正则表达式起步 | 用 Bass.d 阅读全文
posted @ 2009-05-15 22:39 万一 阅读(9650) 评论(227) 推荐(3)
查看内存数据的函数
摘要:重写: 阅读全文
posted @ 2009-05-13 23:53 万一 阅读(7996) 评论(12) 推荐(0)
总结与思考
摘要:虽是半路出家, 但也接触了几种编程语言(主要是 Delphi), 面对未知的程序语言也不再神秘了.所有这些语言, 最终都会编译成另一种语言(二进制的机器码)去和机器交流; 因为人们很难识别只有 0、1 构成的机器码, 所以才有了汇编、汇编还是有点麻烦所以才有了 Delphi 等高级语言, 说起来高级语言已经不算难了.所谓某种语言的功能强大, 其实是 "库" 的强大, 就像 Delphi 强大在 V... 阅读全文
posted @ 2009-05-11 23:00 万一 阅读(2314) 评论(22) 推荐(0)
极快的正整数排序函数
摘要:实现原理: 对比二进制位. unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; M... 阅读全文
posted @ 2009-05-01 01:22 万一 阅读(4772) 评论(8) 推荐(0)