《Delphi》双语
实 验 指 导 书
王晓红 主编
河北科技大学 信息科学与工程 2007.5
目 录
实验(1) Getting Started with Delphi 实验(2) More on Pascal 实验(3) The Delphi IDE Explored 实验(4) The Visual Component Model 实验(5) Working with the Form Designer and the Menu Designer 实验(6) VCL Components 实验(7) Creating Applications;Projects, the Code Editor and the Code Explorer 实验(8) Debugging Your Applications;Delphi Tools and Options 实验(9) Building Database Forms;Building Database Applications
2
实验(1) Getting Started with Delphi
实验目的: 实验目的: 通过几个 Delphi Application 来熟悉 Delphi 集成化开发环境。 实验内容: 实验内容: 通过几个简单的 Dephi 程序来熟悉 Delphi IDE 环境。 实验环境: 实验环境: 操作系统:Windows 2000 开发环境:Delphi 7.0 实验步骤: 实验步骤: 步骤 1.Write a Windows program that displays the
words Welcome to Delphi! on the window when the program runs. 2.Rewrite the program you wrote in step 1 and change the displayed text to Hello There! (Hint: You have to change only the Caption property of the Label component.) 3.Write a program that declares two variables and assign values to those variables. Multiply the two numbers together and display the result on the screen. 4.Write a program that assigns the string, "There are eggs in a dozen." to a variable and then inserts the string "12 " at the appropriate place in the string. Show the result in a label. 5.Write a program that creates the final result string in exercise 4, but formatted with the Format function. 实验报告: 实验报告: 1.实验目的 2.实验内容 3.实验方法 (1)将实验要求用 Delphi 语言编写并调试运行。 (2)查看运行结果,如果结果不正确,进行修改,直到正确为止。 4.实验总结
3
(1) 编译、连接、运行不成功的操作情况,分析原因,改正的过程。 (2) 实验中的问题和提高。 (3) 收获与体会。
4
实验(2) More on Pascal
实验目的: 实验目的: 通过设计几个程序来掌握基本的 Pascal 语法。 实验内容: 实验内容: 通过 Test1、Test2 之间的互调熟悉 Pascal 中的 procedure。 实验环境: 实验环境: 操作系统:Windows 2000 开发环境:Delphi 7.0 实验步骤: 实验步骤: 步骤 1.Write a procedure called Test2 that changes the caption of a Label component. Put a button on a form and have the button's OnClick handler call the Test2 procedure. 2.Take the program from exercise 1 and create another procedure called Test1 that, in turn, calls the Test2 procedure. Change the event handler of the button so that it calls Test1 rather than Test2. 3.Create a program that displays I will never talk back to my mother 20 times in a Memo component. 4.Write a record containing fields represe
nting employee information. Include first name, last name, address, hire date, and a field indicating whether the employee is in the company's insurance plan. 实验报告: 实验报告: 1.实验目的 2.实验内容 3.实验方法 (1)将实验要求用 Delphi 语言编写并调试运行。 (2)查看运行结果,如果结果不正确,进行修改,直到正确为止。 4.实验总结 (1)编译、连接、运行不成功的操作情况,分析原因,改正的过程。
5
(2) 实验中的问题和提高。 (3) 收获与体会。
6
实验(3) The
Delphi IDE Explored
实验目的: 实验目的: 通过对 Delphi IDE 常用组件的使用,熟悉 IDE 环境。 实验内容: 实验内容: 设计并实现 Delphi 不同的表单。 实验环境: 实验环境: 操作系统:Windows 2000 开发环境:Delphi 7.0 实验步骤: 实验步骤: 步骤 1.Remove the