n n n Delphi Delphi IDE Object Pascal
提纲 n n n Delphi 简介 Delphi IDE 简介 Object Pascal 语言 Delphi 数据库体系结构 Delphi 数据库连接 Delphi 示例程序的开发
提纲 n n n Delphi 简介 Delphi IDE 简介 Object Pascal 语言 Delphi 数据库体系结构 Delphi 数据库连接 Delphi 示例程序的开发
Delphi 简介 n 为什么学习Delphi
Delphi 简介 n 为什么学习Delphi
Delphi 简介 n 为什么学习Delphi 可视化开发环境 编辑器 调试器 Trace/Evaluate/Run to Cursor/Watch/…/CPU View 窗体设计器
Delphi 简介 n Delphi的历史
Delphi 简介 n n Delphi的历史 Delphi 1
Delphi 简介 n n n Delphi的历史 Delphi 1 DOS时代 BASIC/ 汇编 Windows 3. 1 C++/ VB 开启的RAD的纪元 Turbo Pascal Delphi 1
Delphi 简介 n n n Delphi的历史 Delphi 1 Delphi 2
Delphi 简介 n n n Delphi的历史 Delphi 1 Delphi 2 1995年Windows 95问世 32位操作系统 VB 4. 0/ Power. Builder
Delphi 简介 n n Delphi的历史 Delphi 1 Delphi 2 Delphi 3
Delphi 简介 n n n n Delphi的历史 Delphi 1 Delphi 2 Delphi 3 Code. Insight技术的引入 Delphi战胜了PB/ Forte Anders Hejlsberg 跳槽到微软
Delphi 简介 n n n Delphi的历史 Delphi 1 Delphi 2 Delphi 3 Delphi 4
Delphi 简介 n n n n Delphi的历史 Delphi 1 Delphi 2 Delphi 3 Delphi 4 Delphi 5 Delphi 6
Delphi 简介 n n n n Delphi的历史 Delphi 1 Delphi 2 Delphi 3 Delphi 4 Delphi 5 Delphi 6 进一步增强Delphi的可用性和效率 XML的支持
Delphi 简介 n Delphi 6 的版本类型
提纲 n n n Delphi 简介 Delphi IDE 简介 Object Pascal 语言 Delphi 数据库体系结构 Delphi 数据库连接 Delphi 示例程序的开发
Delphi 的 IDE 环境
提纲 n n n n Delphi 简介 Delphi IDE 简介 Delphi 源文件 Object Pascal 语言 Delphi 数据库体系结构 Delphi 数据库连接 Delphi 示例程序的开发
提纲 n n n n Delphi 简介 Delphi IDE 简介 Delphi 源文件 Object Pascal 语言 Delphi 数据库体系结构 Delphi 数据库连接 Delphi 示例程序的开发
缺省值 n procedure Has. Def. Val(S: string; I: Integer = 0); n Has. Def. Val(‘hello’, 26); // new value for I n Has. Def. Val(‘hello’); // default value used for I n 向后兼容性
类型 n n n n 类型定义 Type A= array[1. . 2] of Integer; B=record i: Integer; d: Double end;
常量 n n n 常量声明 Const i=10; string 1=‘This is a short string. ’; j: Integer =10; string 1: string= ‘This is a predefined short string’;
变量的声明 n n n Var i: Integer DA: array of string; s: string[45]; a: Ansi. String; …
记录的定义 n n n { Pascal } Type My. Rec = record i: Integer; d: Double; end; /* C */ typedef struct { int i; double d; } My. Rec;
指针定义 n n n Type Pint = ^ Integer; Foo=record a: string; end; Pfoo= ^ Foo; Var P: Pint; P 2: Pfoo; … New(P); P^. a: =‘ A assignment’
动态数组 n n n n var // dynamic array of string: SA: array of string; begin // allocate room for 33 elements: Set. Length(SA, 33); SA[0] : = ‘Pooh likes hunny’; Other. String : = SA[0];
动态数组 n n n n var // dynamic array of string: SA: array of string; begin // allocate room for 33 elements: Set. Length(SA, 33); SA[0] : = ‘Pooh likes hunny’; Other. String : = SA[0];
字符类型 n n n Ansi. Char 标准1字节ANSI字符 Wide. Char 2 字节长Unicode字符 Char 相当于Ansi. Char到Wide. Char
集合类型 n n n type TChar. Set = set of char; // possible members: #0 #255 TEnum = (Monday, Tuesday, Wednesday, Thursday, Friday); TEnum. Set = set of TEnum; // can contain any combination of TEnum members TSubrange. Set = set of 1. . 10; // possible members: 1 - 10 TAlpha. Set = set of ‘A’. . ’z’; // possible members: ‘A’ ‘z’
集合类型 n if ‘S’ in Char. Set then // do something; n if not (Monday in Enum. Set) then // do something; n 并操作和差操作 + / - 或 Include() / Exclude() n Include(Char. Set, ‘a’); // add ‘a’ to set Char. Set : = Char. Set + [‘b’]; // add ‘b’ to set Exclude(Char. Set, ‘x’); // remove ‘z’ from set Char. Set : = Char. Set - [‘y’, ‘z’]; // remove ‘y’ and ‘z’ from set n n n
If 语句 n n n { Pascal } if x = 4 then y : = x; /* C */ if (x == 4) y = x; ‘Visual Basic If x = 4 Then y = x
If 语句 n n n if x = 6 then begin Do. Something; Do. Something. Else; Do. Another. Thing; end;
If 语句 n n n n n if x =100 then Some. Function else if x = 200 then Some. Other. Function else begin Something. Else; Entirely; end;
Case语句 n n n n n case Some. Integer. Variable of 101 : Do. Something; 202 : begin Do. Something; Do. Something. Else; end; 303 : Do. Another. Thing; else Do. The. Default; end;
Case语句 n n n n switch (Some. Integer. Variable) { case 101: Do. Some. Thing(); break; case 202: Do. Something(); Do. Something. Else(); break case 303: Do. Another. Thing(); break; default: Do. The. Default(); }
提纲 n n n n Delphi 简介 Delphi IDE 简介 Delphi 源文件 Object Pascal 语言 Delphi 数据库体系结构 Delphi 数据库连接 Delphi 示例程序的开发
Delphi 数据库类型 n n Delphi 支持的数据库类型 BDE (Borland Database Engine) q n ADO (Active. X Data Objects) q n n Borland 标准 Microsoft 标准 db. Express 组件 Inter. Base 组件
提纲 n n n n Delphi 简介 Delphi IDE 简介 Delphi 源文件 Object Pascal 语言 Delphi 数据库体系结构 Delphi 数据库连接 Delphi 示例程序的开发
Delphi 数据库连接 n n n n 数据集到后台连接通常由连接组件实现 TCustom. Connection 组件 数据访问机制 连接组件 BDE数据集 TDatabase ADO数据集 TADOConnection db. Express数据集 TSQLConnection Inter. Base数据集 TIBDatabase
提纲 n n n n Delphi 简介 Delphi IDE 简介 Delphi 源文件 Object Pascal 语言 Delphi 数据库体系结构 Delphi 数据库连接 Delphi 示例程序的开发
- Slides: 105