摘要: unit Unit1; interface {接口部分开始} uses {引用单元列表,这是可选的,如果包含必须紧跟interface关键字} {接口部分声明常量/类型/变量/过程和函数,这些声明对引用单元就像自己的声明一样} {在接口部分声明的过程和函数,就像使用了forward关键字} {接口部分结束} implementation {实现部分} uses ... 阅读全文
posted @ 2007-11-22 14:54 万一 阅读(8368) 评论(4) 推荐(4) 编辑
摘要: 推荐使用 Classes.ExtractStrings 函数. function Split(ss,s:string): TStringList; begin Result := TStringList.Create; while Pos(s,ss)>0 do begin Result.Add(Copy(ss,1,Pos(s,ss)-1)); Delete(ss,... 阅读全文
posted @ 2007-11-21 16:35 万一 阅读(5605) 评论(11) 推荐(0) 编辑
摘要: function GetFileSize(const FileName: String): LongInt; var SearchRec: TSearchRec; begin if FindFirst(ExpandFileName(FileName), faAnyFile, SearchRec) = 0 then Result := SearchRec.Size else R... 阅读全文
posted @ 2007-11-21 16:28 万一 阅读(4937) 评论(5) 推荐(0) 编辑
摘要: // ================================================================ // 遍历某个文件夹下某种文件, // 使用说明 //  _GetFileList(ListBox1.Items,'c:\*.doc'); // _GetFileList(MyTStringList,'c:\*.exe'); /... 阅读全文
posted @ 2007-11-21 13:42 万一 阅读(6045) 评论(13) 推荐(1) 编辑
摘要: //工程引用此单元就能防止同时出现多个实例unit MultInst;interfaceuses Windows ,Messages, SysUtils, Classes, Forms;implementationconst STR_UNIQUE = '{2BE6D96E-827F-4BF9-B33E-8740412CDE96}'; MI_ACTIVEAPP = 1; {激活应用程序} MI_... 阅读全文
posted @ 2007-11-21 13:38 万一 阅读(7118) 评论(15) 推荐(1) 编辑
摘要: //隐藏与显示菜单 Self.Menu := nil; {隐藏菜单} Self.Menu := MainMenu1; {显示菜单} 阅读全文
posted @ 2007-11-21 13:08 万一 阅读(6753) 评论(9) 推荐(2) 编辑
摘要: program Project1; {$APPTYPE CONSOLE} var str: string; begin Writeln('请输入:'); Readln(str); Writeln('你输入的是:' + str); Readln; end. 阅读全文
posted @ 2007-11-21 13:05 万一 阅读(6878) 评论(5) 推荐(1) 编辑
摘要: program Project1; uses Windows; begin MessageBox(0,PChar('Ok!'),PChar('Title'),0); end. 阅读全文
posted @ 2007-11-21 13:02 万一 阅读(8445) 评论(7) 推荐(0) 编辑
摘要: program Project1; {$APPTYPE CONSOLE} //uses // SysUtils; {这两行,在本程序中无用,如果带着程序大小是:44.5k; 注释掉程序是19k} begin Writeln('ok'); Readln; end. 阅读全文
posted @ 2007-11-21 13:01 万一 阅读(12096) 评论(10) 推荐(1) 编辑
摘要: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private ... 阅读全文
posted @ 2007-11-12 17:49 万一 阅读(4515) 评论(9) 推荐(0) 编辑