摘要: //例1: procedure TForm1.Button1Click(Sender: TObject); var str: string; p: Pointer; begin p := @str; //变量 str 的地址 p := @Form1; //变量 Form1 的地址 p := @TForm1.Button1Click; //过程 TForm1.Butt... 阅读全文
posted @ 2007-11-26 23:27 万一 阅读(4983) 评论(2) 推荐(0) 编辑
摘要: procedure TForm1.Button1Click(Sender: TObject); var x: Integer; label n1,n2,n3,4; //goto的标签可以是标识符, 也可以是0..9999的数字 begin x := 0; goto n3; n1: x := x+1; n2: x := x+2; n3: x := x+3; 4: ... 阅读全文
posted @ 2007-11-26 22:55 万一 阅读(5426) 评论(6) 推荐(0) 编辑
摘要: //Byte procedure TForm1.Button1Click(Sender: TObject); var x,y: Byte; begin x := MAXBYTE; //MAXBYTE是常数255 y := not x; //y 的值是 0 x := 5; y := not x; //y 的值是 250 ShowMessage(IntToStr(y)... 阅读全文
posted @ 2007-11-26 22:40 万一 阅读(3491) 评论(10) 推荐(0) 编辑
摘要: 基本类型:数字Number,字符串String,布尔值Boolean; 复合类型:对象Object,数组Array; 工具类型:全局对象Global,日期Date,数学对象Math,正则表达式RegExp,错误对象Error; 特殊类型:函数Function。 阅读全文
posted @ 2007-11-26 13:17 万一 阅读(2375) 评论(4) 推荐(1) 编辑
摘要: 'BORLAND' { BORLAND } 'You''ll see' { You'll see } '''' { ' } '' { 空串 } ' ' { 空格 } #89#111#117 { You } #89'Y'#89 { YYY } #89 + 'Y' + #89 { YYY } #13#10 { 换行 } 阅读全文
posted @ 2007-11-26 11:58 万一 阅读(4585) 评论(2) 推荐(0) 编辑
摘要: //uses 子句一般这样写 uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; //这样写更清晰,因为Delphi忽略换行 uses Windows, Messages, SysUtils, Variants, Classes, Graph... 阅读全文
posted @ 2007-11-26 11:50 万一 阅读(6990) 评论(1) 推荐(0) 编辑