官术网_书友最值得收藏!

Do you speak Object Pascal?

The Object Pascal language has been designed for teaching good programming practices. It is a high-level, modern, and strongly typed compiled language that supports structured and object-oriented programming.

In order to solve a problem using a computer, you need to define a finite set of actions that operate on certain data or, in other words, to define an algorithm. An algorithm expressed in a programming language is a computer program, and its actions are described as programming language instructions.

One or more actions performed on certain data can be encapsulated in the Object Pascal language as a routine or a class. In Object Pascal, routines are called functions. If a function does not return a value, it is called a procedure. Classes are the corner stones of object-oriented programming, which is the most important approach to building apps in Object Pascal. Objects group the data and the operations performed on this data together, providing encapsulation and reusability.

In the previous chapter, you learned about compilers. The job of a compiler is to process one or more files that contain the text of the programs that we write in a programming language and generate a binary file that can be loaded by an operating system and executed. Compilers may also generate other types of binaries, such as packages or services. In this chapter, we will focus on the contents of the files that contain the source code of our programs. Source code files are regular text files that can be opened in an arbitrary text editor. The default extension of a file that contains the Object Pascal source code is .pas. When you install Delphi, it will register itself with Windows as the default program for opening different file types related to Delphi programming, including .pas, .dpr, .dpk, .dproj, and a few more.

The source code file needs to contain proper content according to the rules of the programming language. If you try to compile a file that is not properly structured or that contains programming language errors, the compiler will stop the compilation and report an error message describing the location and nature of the error. Sometimes the error message might not be obvious, but we would typically get the name of the source file and the text line number where the error is located.

主站蜘蛛池模板: 临西县| 同仁县| 清新县| 新绛县| 夹江县| 和政县| 内丘县| 富源县| 北辰区| 宽城| 凯里市| 渭源县| 万荣县| 子洲县| 凤庆县| 册亨县| 岐山县| 淮滨县| 涞源县| 鹤庆县| 岳阳市| 吉木萨尔县| 普陀区| 高台县| 都江堰市| 班玛县| 通山县| 裕民县| 塔河县| 汉寿县| 甘谷县| 芦溪县| 酒泉市| 普兰县| 翼城县| 宁津县| 临西县| 辽源市| 拜泉县| 蓬安县| 平昌县|