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

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.

主站蜘蛛池模板: 太康县| 平原县| 正阳县| 固安县| 潮安县| 双牌县| 兴安县| 柘荣县| 大安市| 尤溪县| 河曲县| 循化| 内乡县| 新津县| 封丘县| 江安县| 昌邑市| 穆棱市| 志丹县| 婺源县| 房山区| 阿荣旗| 马鞍山市| 嘉峪关市| 庐江县| 越西县| 翁牛特旗| 桐柏县| 太白县| 临西县| 浪卡子县| 彰武县| 商丘市| 钦州市| 正安县| 陇西县| 石嘴山市| 阿拉善左旗| 建湖县| 郓城县| 兴安县|