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

  • Expert Delphi
  • Pawe? G?owacki
  • 390字
  • 2021-07-02 20:44:22

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.

主站蜘蛛池模板: 淮滨县| 灯塔市| 云南省| 陵川县| 乌兰察布市| 丁青县| 揭阳市| 小金县| 铜川市| 赤水市| 明星| 洛浦县| 南投县| 博湖县| 平昌县| 邵东县| 凤山市| 上饶市| 林州市| 大新县| 伊金霍洛旗| 满城县| 巴林右旗| 阿瓦提县| 阜阳市| 周宁县| 蓬安县| 吉木乃县| 皮山县| 武陟县| 鄢陵县| 嘉荫县| 巫山县| 峨山| 盘山县| 城口县| 文安县| 孟州市| 萝北县| 扎鲁特旗| 广昌县|