Programming systems. Test “Pascal programming environment” Programs for programming in the Pascal environment

Although Pascal is a relatively old programming language, created by Niklaus Wirth in 1968-69 specifically for teaching students programming, with the advent of personal computers it has become widespread not only in the educational sphere, but also in solving various applied problems.

In 1986, Apple developed an object extension of the Pascal language, resulting in Object Pascal. It was developed by Larry Tesler's group, who consulted with Niklaus Wirth.

Turbo Pascal

In 1983, the first implementation of the Turbo Pascal tool environment appeared, designed for IBM-compatible computers. It included a shell (the interface through which a person communicates with a computer: typing and launching programs, reading results, etc.), text editor, translator and debugger. Since then, the Turbo Pascal programming system has been continuously improved by Borland International. A developed hint system has appeared, a system for assembling the entire program from individual modules (linker), rich libraries of subroutines and much more. Complex software, used by programmers for development software, began to be called integrated development environment (Integrated Development Environment, IDE, sometimes referred to as ISD), or just a programming environment.

In 1992, ISR was presented using the Object Pascal language - Turbo Pascal 7.0. This is where the development of Turbo Pascal ended. The Turbo-Pascal ISR window is shown in Fig. 2.1.

Rice. 2.1. Creating a new program window in Turbo Pascal

Free Pascal

Freely distributed compilers of the Free Pascal programming system are implemented in many Linux distributions, there are free compilers for Windows XP/7/10. A free multi-platform environment has been created based on Free Pascal Lazarus, similar to the Delphi environment. Free Pascal is very similar in appearance to Turbo Pascal, although it is multi-platform.

The initial screensaver of this ISR is shown in Fig. 2.2.

Since Free Pascal is freely distributed software, it can be downloaded from the website http://freepascal.org/ and install for free. This site also contains all the documentation for Free Pascal.

Fig.2.2. Free Pascal splash screen.

Pascal ABC.NET

This ISR is closest to professional system Delphi, that is, was developed without regard to the old MS DOS OS. As a result, there is a toolbar, bookmarks for quickly switching between programs, 2 windows: input and output of results. The educational programming system Pascal ABC.NET (author – S.S. Mikhalkovich) is a dialect of the standard Pascal language. It is designed to make a gradual transition from the simplest programs to object-oriented programming of complex software products already based on Delphi.



The beginning of work in this WBS is presented in Fig. 2.3.

Although it is believed that the Pascal integrated development environment ABC.NET is fully compatible with the Object Pascal programming language, this is not the case. There are quite a lot of changes in Pascal ABC.NET, listed in Appendix B, taken from the Basic, C languages, and most importantly, from the .NET platform. Therefore, although at first it seems that the language used in Pascal ABC.NET is the same as Object Pascal, it is not.

Of course, in some cases it is easier to write a short (training) program in the Pascal ABC.NET environment, but it is still better to use a standard programming language.

In any case, this is also freely distributed software located on the site http://pascalabc.net/.

Fig.2.3. Getting started in Pascal ABC.

Delphi is a professional programming environment, although it is based on the same Object Pascal programming language. ISR Delphi has come a long way, starting with Borland Delphi (1995) for Windows 3.1, then for Windows 95 (still 16-bit). There were versions of Delphi from 2.0 to 8.0 (1996-2003), Delphi 2005-2010 with the corresponding release years. Since 2010, ISR Delphi XE began to be produced, then Delphi XE2 (2011) and so on.

The introduction will briefly discuss working with the Free Pascal environment. Working with other WBS is very similar.

After the program has been compiled, it must be entered into the computer. This is where we come across tool packages Free programs Pascal or Pascal ABC. The Free Pascal package contains not only a translator from the Object Pascal language, but also a text editor, a tool shell, a debugger, a description of the ISR, extensive program libraries and much more, for example, object-oriented programming example programs.



It is intended to connect the main of these programs into a single whole, to create a convenient and visual interface. integrated software development environment, briefly ISD.

The ISR is called by launching either from the desktop or using the Start menu button the fp.exe file. After launching the fp.exe file, the main screen of the ISR appears, consisting of three parts: the menu bar, the work area and the status bar in accordance with Fig. 2.2.

When the ISR is initially launched, one window is open in the work area with the number 1 in the upper right corner and with the title noname01.pas. In the future, after recording the program to disk, the standard title will be replaced by the name of the program given to it when recording. If the work area is empty, then a new window is created with the command File > New, as shown in Fig. 2.4.

Rice. 2.4. View of the ISR window after running the fp.exe file in windowed mode

Flashing cursor indicates the location on the screen where the next text character will appear. The entry of each new line ends with a key press Enter. The compiler does not distinguish between uppercase and lowercase letters, so it does not matter in what case the Latin letters are typed. So, the following lines would be equivalent:

When typing text, special attention must be paid to the exact reproduction of all characters: periods, semicolons, apostrophes, spaces, since the compiler is very sensitive to details of this kind.

The menu bar is activated by the F10 key (if controlled from the keyboard) and consists of 10 items, which, in turn, expand into drop-down submenus:

File– allows you to perform all basic operations with files: create new ones, load existing ones, save created and edited files, print the contents of these files, end the session with the ISR, and so on.

Edit– makes it possible to perform basic text editing operations.

Search– allows you to search for text fragments and, if necessary, replace the found fragment with a new one.

Run– allows you to launch a program located in the work area, and also, if necessary, step by step this program or part thereof. If changes have been made to the program, it is automatically recompiled when launched.

Compile– it is possible to compile a program that is in the work area without executing it in order to check for errors.

Debug– contains commands that facilitate the process of finding errors in the program: placing breakpoints, visualizing the debug window, register windows, output windows, and so on.

Tools– makes it possible to execute some programs without leaving the ISR.

Options– here are commands that allow you to set the compiler and ISR parameters necessary for operation.

Window– allows you to perform all basic operations with windows (although they are much more convenient to perform with the mouse): open, close, move, resize.

Help– allows you to get the information available in the system background information.

The menu system allows you to execute almost all commands of the ISR and integrated programs, and is made in accordance with the SAA (Turbo Vision) standard.

The status bar at the bottom of the screen, in edit mode, shows some of the frequently used WBS operations and shortcut key combinations that allow you to perform the corresponding operations, bypassing the standard procedure for calling them through the menu. In some modes, hints or other help information are displayed here.

This environment also provides tooltips, for example, in Fig. 2.5 (in the gray (green) frame there is a tooltip for the service word Program).

Rice. 2.5. Tooltips in Free Pascal.

The Free Pascal programming language is a free offshoot of the classic Pascal language, developed by Niklaus Wirth in the late 60s. N. Wirth developed this language to teach students procedural programming skills. Over time, the Pascal language has been greatly developed, and many dialects of this language have emerged (the most famous of them is Turbo Pascal from Borland).

Free Pascal is a free implementation of the Pascal language (more precisely, a freely distributed compiler of the Pascal programming language), supports object-oriented programming and can be used to write not only curricula, but also more serious data processing applications.

Free Pascal programming environment

Let's look at the installation process.

1) For Windows OS users, you need to download the installer from the Internet page http://www.freepascal.org/down/i386/win32.var and run it with administrator rights.

2) For Linux users you can download a fresh rpm or deb installation package (for example, Alt-Linux uses rpm packages, and Ubuntu or Debian uses deb packages).

There are easy installation options:

via terminal:

Sudo apt-get install fpc

Fpc is a meta-package that includes the compiler itself and the development environment (IDE, “shell” for editing code, debugging and running compiled code). The sudo command starts the installation of the fpc metapackage in administrator mode, do not forget to enter the correct password.

2) using package manager Synaptic. Find the fpc package, check it for installation and apply the changes:

Installing Free Pascal using the Synaptic package manager

If you are the owner of the Alt-Linux School distribution, then you are lucky, Free Pascal is already installed.

Launching IDE Free Pascal (IDE - Integrated Development Environment)

Bring up a terminal and type: fp

The interface is very similar to the classic Turbo Pascal 7.0 environment interface

Geany Development Environment

To simplify the process of creating a program and get rid of the problem of displaying the Cyrillic alphabet, you can install the free development environment Geany. This shell has a pleasant graphical interface, supports several programming languages ​​(Pascal, C, PHP, etc.).

Installing the Geany development environment

1) using terminal:

Sudo apt-get install geany

2) using the Synaptic package manager. The installation process will be completely similar to the installation process of the fp metapackage

3) you can download the installation package from the official website of the developers: http://www.geany.org/Download/Releases.

Here is an example of creating a simple program that prints the squares of integers from 1 to 15.

1. After starting the Geany environment, create a Pascal file template:

Choosing a Pascal template

2. Save the text of the program in any folder convenient for us. After saving, the shell window will look something like this:

Saved text with pascal template

3. Be sure to change the program name (Latin, without spaces), because the compiler will throw an error when compiling the text into executable code.

4. Let's write the text of a program that displays the squares of numbers from 1 to 15 and compile it. When compiling, the program text file is automatically saved.

Compiling the current program file

5. Launch the program by clicking on the icon or using the main menu Build→Run:

Result of the program

6. In the folder where we saved the program text, you can find files with the extension *.pas - program text; *.o - a compiled file (object file) and a ready-made executable file without an extension (for GNU\Linux OS), which can be executed in the terminal.

Lazarus visual programming environment

Console applications (running in the terminal or command line) are of course good, but how can you create an application with a graphical interface in the GNU\Linux environment?

You may have heard about Borland's Delphi - this is a rapid development environment for programs with a graphical interface in the Object Pascal language (later called simply Delphi language). What is the advantage of such an environment (and other similar visual development environments)? The advantage is that the programmer does not worry about programmatically drawing the application window, placing buttons, lists and other graphic elements on it - the Delphi environment itself takes care of this; The programmer is directly involved in processing various events and the actual data processing algorithm.

Lazarus is a free (and therefore completely free!) software development environment for the Free Pascal language compiler. The integrated development environment provides the ability to develop applications in a Delphi-like environment. Moreover, it is possible to create cross-platform applications that run on both the Windows operating system and the GNU\Linux operating system.

Installing Lazarus

1) using terminal:

Sudo apt-get install lazarus

2) using the Synaptic package manager. Check the boxes next to the programs Lazarus, fp, fpc, fpc-ide

Here we will try to understand such a programming language as Pascal, and to be more specific, its implementation in the programming system Turbo Pascal. Highlights of the material:

  • Basics of the Pascal language and the Turbo Pascal programming system;
  • Structure of the Turbo Pascal programming system;
  • Basic keys and keyboard shortcuts in Turbo Pascal;
  • Basic techniques for working with a program code editor;
  • Let's write the first program in Turbo Pascal;
  • Data types in Turbo Pascal.

Theory on the Turbo Pascal language

Pascal programming language got its name in honor of the outstanding French mathematician, physicist, philosopher Blaise Pascal (1623-1662), who invented a mechanical calculating machine for performing arithmetic. In 1965, the International Federation for Information Processing (IFIP) invited several computer scientists to participate in the creation of a new programming language. They included the Swiss scientist N. Wirth. Very soon, he and his colleagues from the Federal Technical University prepared the first version of Pascal, then the first version of the compiler, and in 1971 a description of the language was published. In the mid-80s. Borland International, Inc (USA) created the Turbo Pascal programming environment to improve the quality and speed of program development, which expanded the scope of the language and provided the basis for the development of the programming language itself.

Programs that are developed in Pascal include the following actions: entering and editing text in a programming language, broadcasting and debugging the program. Each stage requires special tools: a text editor, a compiler, which includes a linker for building a computer-executable program module, and a debugger for debugging the program. The Turbo Pascal programming system is also called an integrated programming environment, since it combines all the previously separate tools used in program development.

The following reasons contributed to the wide popularity of Pascal:

  • Thanks to its compactness and successful initial description, the language turned out to be quite easy to learn;
  • It captures the fundamental concepts of algorithms in an easily understandable form;
  • Pascal allows you to clearly implement the ideas of structured programming and make the transition to object-oriented programming ( Turbo Pascal language provides the programmer with all the tools of OOP: a high degree of structure, modularity, abstraction and reusability, which are built directly into the language);
  • The programming language made it possible to move to systems for automatically checking the correctness of programs.

Turbo Pascal programming system represents the unity of two, to a certain extent, independent principles: a compiler from the Pascal programming language and some instrumental software shell that helps increase the efficiency of creating programs. For brevity, we will henceforth call the Pascal programming language implemented by the compiler the Turbo Pascal language, and the various services provided by the software shell the Turbo Pascal environment.

In order to run Turbo Pascal you need to open the TURBO.EXE file. This file is responsible for launching the ready-to-run Turbo Pascal dialog programming system. The system includes only the necessary parts of Turbo Pascal ( text editor, compiler, linker, loader). For normal operation of the system, you will also need the main library, located in the TURBO.TPL file, and a help desk ( TURBO.HLP file) In principle, these files will be enough to write, compile and execute small programs.
Let’s say right away that to exit Turbo Pascal you should press Alt key and, without releasing it, the key with the Latin letter X, after which you can release both keys.

Structure of the Turbo Pascal programming system

A software block consisting of 2 sections:

1. Descriptions section, which should describe all identifiers found in the program. He is:
list of names of plug-in library modules ( defined by the reserved word uses);

  • description of tags;
  • description of constants;
  • defining data types;
  • description of variables;
  • description of procedures and functions;

The description section begins with a function word corresponding to each element of the list, followed by a sequence of values ​​of the same type, separated by a comma. The list of names is followed by a colon and the data type is indicated.

2. Operators section.

This section begins with the function word Begin and ends with the function word End. Next, actions are specified on program objects entered in the descriptions section. The operators by which these actions are performed are separated by semicolons. After the last word End there is a period.

To better understand the program text and find errors, the following scheme is recommended:
reserved words program, procedure, function, etc. written in lowercase letters;

  • identifiers begin with capital letters;
  • operators are written in lowercase letters;

The top “menu” contains a line of possible operating modes of Turbo Pascal, the bottom one contains a small reference about the combination of the main function keys. The rest of the screen belongs to the code editor window, which is used for entering and correcting program texts. Its top line contains the name of the disk file from which the program text was read ( the new file is named NONAME00.PAS) two special fields used when working with an input device " mouse"(uh These fields are marked with square brackets), and the number one is the window number. In Turbo Pascal, it is possible to work simultaneously with several programs ( or forms of one large program), each of which can be located in a separate code editor window. The environment allows you to use up to nine editor windows simultaneously.

In addition to the code editor window, Turbo Pascal also uses windows for debug mode, output of program results, and help desk. If you want, they can be called up on the screen gradually or present on it simultaneously.

Basic operating keys are used to control the Turbo Pascal environment. They are designated Fl, F2, ..., F12 and are located at the top of the keyboard. Each of these keys is associated with a menu command. The action of almost all function keys can be characterized by three special keys: Alt ( from ALTernative - additional), Ctrl ( ConTRoL - manager) and Shift ( SHIFT - shift). These keys are used like the shift keys on a typewriter: you press one of them and then, without releasing it, press the other key.
Now we present the commands that are transmitted to the Turbo Pascal environment function keys and some of their combinations with Ctrl keys and Alt:

  • Fl—Seek help from the built-in help service ( Help);
  • F2 - write edited text to disk file;
  • F3 - read text from a disk file into the editor window;
  • F4 - used in debugging mode: start or continue execution of the program and stop before executing the line on which the cursor is located;
  • F5 - expand the active window to full screen;
  • F6 - make the next window active;
  • F7 - used in debug mode: execute the following line of the program; if the line contains a call to a procedure ( functions), enter this procedure and stop before executing its first statement;
  • F8 - used in debug mode: execute the following line of the program; if the line contains a call to a procedure ( functions), execute it and not monitor its work;
  • F9 - compile the program, but do not execute it;
  • F10 - go to the dialog selection of the operating mode using the main menu;
  • Ctrl-F9 - run the program: compile the program located in the editor, load it into RAM and execute it, then return to the Turbo Pascal environment.
  • ALT-F8 - change the editor window to a window that displays work results ( run) programs.

The text editor of the Turbo Pascal system provides the programmer with convenient tools for creating and editing program codes. A sign that the system is in an editing state is the presence of a cursor in the editor window. Editing mode is automatically installed immediately after loading Turbo Pascal. From the editing mode, you can switch to any other mode of Turbo Pascal using special keys or selecting the appropriate mode from the main menu. If the environment is in a menu selection state, the cursor disappears and a colored rectangle pointer appears in the menu bar, highlighting one of the code words ( menu options). To move from the mode selection state from the main menu to the editing state, you need to press the Esc key ( ESCape - slip away, run away), and to go to the selection from the main menu - F10.

Let's look at the basic techniques for working with the program code editor

To write program code, you need to enter this text using the keyboard, just like when you normally type text. After filling out the next line, press the Enter key to move the cursor to the next line ( the cursor always shows the place on the screen where the next entered program character will be placed).
The code editor window looks like a long and fairly wide piece of paper that is visible in the window. If the cursor reaches the bottom edge, the editor window scrolls: its contents move up one line and a new sheet line appears at the bottom. If the cursor has reached the right border of the program, the window begins to move to the right as characters are entered, showing the right edge of the sheet. The horizontal and vertical dimensions of the sheet are limited only by the total number of characters in the file, which should not exceed 64535, but the Turbo Pascal compiler accepts program lines no longer than 126 characters.
The window can be moved relative to the sheet using the keyboard shortcut:

  • Page Up - up the page;
  • Page Down - page down;
  • Note - to the beginning of the current line;
  • End - to the end of the current line;
  • Ctrl-Page Up - to the beginning of the text;

If you make a mistake when entering the next character, you can erase it using the arrow key ( or "Backspace") located on the keyboard. The Delete key erases the character on which this moment indicates the cursor, and the Ctrl-Y command indicates the entire line on which the cursor is located.

Please remember that the Turbo Pascal code editor inserts a special delimiter character at the end of each line. This character is inserted with the Enter key and erased with the Backspace or Delete keys. By inserting/erasing a delimiter, you can “cut”/“glue” lines. To cut a line, move the cursor to to the right place and press Enter, to merge adjacent lines, you need to place the cursor at the end of the first line (for this it is convenient to use the End key) and press Delete or place the cursor at the beginning of the second line and press Backspace.

The normal mode of operation of the code editor is insertion mode, in which each newly entered character is like “ spreads» text on the screen, shifting the rest of the line to the right. Please note that cutting text and then inserting missing lines is only possible in this mode. The editor can also work in the mode of overlaying new characters on existing old text: in this mode, the new character replaces the character the cursor is pointing at, and the rest of the line is not shifted to the right. To switch to blending mode, you need to press the Insert key, and if you press this key again, the insert mode is set again. An indication of which mode the editor is in is the shape of the cursor: in insert mode it looks like a blinking underscore, and in overlay mode it looks like a large blinking rectangle that obscures the entire character.

And one more feature of the editor. Typically the editor operates in auto-indent mode. In this mode, each new line begins at the same position on the screen as the previous one. The auto-indentation mode supports a good style of program text: indentations from the left edge highlight the body of a conditional or compound statement and make the program more visual. You can refuse auto-indent using the command Ctrl-O I ( when Ctrl is pressed, the key with the Latin letter O is pressed first, and then O is released and I is pressed), repeating the Ctrl-O I command will restore auto-indent mode.

Listed below are the most commonly used Turbo Pascal editor commands.

  • Page Up - up the page;
  • Page Down - page down;
  • Home - to the beginning of the current line;
  • End - to the end of the current line;
  • Ctrl-Page Up - to the beginning of the text;
  • Ctrl-Page Down - to the end of the text.

Editing commands:

  • Backspace - erases the character to the left of the cursor;
  • Delete - erases the character the cursor is pointing at;
  • Ctrl-Y - erases the line with the cursor;
  • Enter - inserts a new line, cuts the old one;
  • Ctrl-QL - restores the changed line (valid if the cursor did not leave the line after it was changed).

Working with a block:

  • Ctrl-KB- starts block selection;
  • Ctrl-K K - ends the selection of the block;
  • Ctrl-K Y - destroys the selected block;
  • Ctrl-C - copies the block;
  • Ctrl-K V - moves the block to a new location;
  • Ctrl-KR - reads a block from a file;
  • Ctrl-K P - prints a block.

As already mentioned, immediately after starting Turbo Pascal, the system goes into code editing mode, in which you can prepare new program or fix an existing one.
The main form of storing program texts outside the environment are files. After finishing working with Turbo Pascal, you can save the code of the new program in a disk file in order to use it after some time. To exchange data between disk files and the environment editor, use the F2 keys ( write to file) and F3 ( reading from file). If you create a new program, the environment does not yet know the name of the file in which you want to place the text of this program, and therefore it assigns it the standard name NONAME00.PAS( NO NAME - no name). To save the program text in a file, press F2. At this point, the environment will check the program name and, if it is the standard NONAME name, will ask if it needs to be changed: a small prompt window will appear on the screen saying

Below the inscription there is a field for entering the file name, in which you can write desired name and press Enter - the text will be saved in a file. If the extension is omitted from the name, the environment will give the file the standard PAS extension. If you want to quit working with Turbo Pascal, but there is still text in the editor that is not saved in the file, a window with a request will appear on the screen

NONAMEOO.PAS has been modified. Save? (The NONAMEOO.PAS file has been modified. Do you want to save it?)

In response, you should press Y (Yes) if you need to save the text in a file, or N (No) if you do not need to save the text.

Running and debugging the program

After writing the program code, you can try to execute it, i.e. compile the program, link it ( if necessary) with a library of standard procedures and functions, load it into RAM and transfer control to it. This entire sequence of actions is called program execution and is implemented with the Ctrl-F9 command.
If there are no syntax errors in the program, then all actions are performed sequentially one after another, while a small window reports the number of compiled lines and the amount of available random access memory. Before transferring control to the loaded program, the environment clears the screen ( more precisely, it displays the program run window), and after the program finishes, it again takes control of the computer and restores the editor window on the screen.

If at any stage the environment detects an error, it stops further actions, restores the editor window, and places the cursor on the line of the program that encountered an error during compilation or execution. In this case, a diagnostic message about the cause of the error appears in the top line of the editor. All this allows you to very quickly debug the program, i.e. eliminate it syntax errors and make sure it works correctly. If the error occurred during the run-time of the program, simply indicating the location where it was found may not give necessary information, since the error may be a consequence of incorrect data preparation in previous program statements. For example, if the error occurred as a result of taking the square root of a negative number, the statement in which the root was extracted will be indicated, although it is clear that the root cause of the error must be sought somewhere earlier, where the corresponding variable is assigned a negative value. In such situations, they usually resort to step-by-step execution of the program using commands associated with the F4, F7 and F8 keys. While you have not yet accumulated sufficient debugging experience, you can use one F7 key, after pressing which the environment will compile and link ( connection with a library of standard procedures and functions) and loading the program, and then stops the run before executing the first statement. The program line containing this statement will be highlighted on the screen with a pointer ( color). Now each new press of F7 will cause the execution of all operations programmed in the current line, and the pointer will move to the next line of the program. In a suspicious place in the program, you can view the current value of a variable or expression. To do this, you need to place the cursor at the place in the line where the name of the variable you are interested in is located, and press Ctrl-F4. A dialog box consisting of three fields ( the top field will contain the variable name, the other two fields will be empty). Press Enter to get the current value of the variable in the middle field. If before pressing Ctrl-F4 the cursor was on an empty part of the line or pointing to the name of another variable, the top field of the dialog box will also be empty or contain the name of that other variable. In this case, use the keyboard to enter the name of the desired variable and press Enter. By the way, in this way you can enter not only the names of the tracked variables, but also expressions - the environment will calculate and show the value of the entered expression.

Turbo Pascal Reference

A very important part of the Turbo Pascal system is the built-in help service. If you are good at English language, you will not have any problems when working with Turbo Pascal: in a difficult situation, just press F1 and the necessary help will appear on the screen. It depends on the current state of the environment, which is why the help desk is called context-sensitive. For example, if you press F1 when the environment has detected an error in the program, the help will indicate additional information about the causes of the error and recommendations for eliminating it.
There are four ways to access the help desk directly from the editor window:

  • F1 - get context-sensitive help;
  • Shift-Fl - select help from the list of available help messages
  • Ctrl-Fl — obtaining help about the desired standard procedure, function, standard constant or variable;
  • Alt-Fl - get the previous certificate.

Using the Shift-F1 key combination, a window will appear on the screen containing an alphabetically sorted list of standard procedures, functions, types, constants and variables for which you can obtain the necessary reference information.

The same information can be obtained in another way. Type the name of the procedure on the screen ( function, type, etc.) or move the cursor to a standard name in the text and press Ctrl-Fl. The environment will analyze the cursor's immediate environment, highlight the name and provide the necessary help.

In many cases, the reference information contains a small example that illustrates the relevant features of Turbo Pascal. Don’t rush to memorize it or write it down on a piece of paper: it can be “cut out” from the help and transferred to the editor window. To do this, after calling the help, press Alt-E, select the continuation of Copy examples in the additional menu that appears ( copy examples) and press Enter - the example text will be copied to the editor’s internal buffer. To extract an example from the buffer, press Esc, to exit the help service, move the cursor to a free line in the editor window, press Shift-Insert ( copying the contents of the buffer into the program text) and Ctrl-KH to remove the color highlighting of copied text.

Your first Turbo Pascal program

Here we will study the Turbo Pascal kernel - a minimum set of tools sufficient to write relatively simple programs. In particular, we will consider some language operators, the most popular data types and operations on them.

To get acquainted with the Turbo Pascal language, let's try to write a small program that displays a message on a computer monitor. Let this be the phrase " This is my first program" Here is a possible version of such a program:

Example:

Program My_First_Program;
const
Text = ‘This is my first program’;
begin
WriteLn(Text);
end

First of all, let's look at the form of code presentation.
First line
Program My_First_Program;
It begins with the word Program and contains a declaration of the name of the program. The word Program is reserved in Turbo Pascal, i.e. cannot be used for any purpose other than declaring the program name. Turbo Pascal has many reserved words. Any of them cannot be used as an identifier ( name) of any program object - a variable, a constant, and so on. By the way, the Turbo Pascal system editor usually highlights reserved words in color.
In this example, the name My_First_Program serves as the English phrase " My First Program", but only written without spaces - a space is a separator and cannot be used arbitrarily ( underscores are allowed instead of spaces in identifiers).
The first line ends with a special delimiter - a semicolon. This delimiter in Turbo Pascal marks the end of a statement or description. Using a special delimiter allows you to place multiple statements on the same line.

Second line

Denotes a single reserved word const, meaning that one or more constants (CONSTants) will be described below. In the language, constants are considered to be those program objects that cannot change their value. Unlike many other programming languages, a constant in Turbo Pascal can have its own name, following the scientific and engineering practice of naming frequently used constants. For example, from school we remember the existence of the constant P = 3.14159265. When processing the program, the name of the constant P will be replaced by the compiler with its value.
To describe a constant in Turbo Pascal means to indicate its name and value. This indication is contained in the third line

Text = ‘This is my first program’;

the Text constant is assigned the value of the character string " This is my first program».
Turbo Pascal can use constants of different types - integers or real numbers, characters, character strings, arrays, etc. A sign that Text is a constant of the character string type are two apostrophes framing the line, and the apostrophes themselves do not belong to this line, but only indicate to the compiler that all the characters contained in them should be considered as a single whole - a text constant. If you need to include the apostrophe itself in a text constant, just write it twice in a row. For example, description
Text = ‘Turbo! ‘ ‘Pascal’; will create a constant with the value Turbo Pascal.

All three first lines are not associated with any specific actions during program execution. They tell the compiler some information about the program itself and the objects used in it. This part of the program is called the descriptions section. The reserved word begin on line four signals the compiler to begin another part of the program—the statement section. In our example, this section contains the statement

WriteLn(Text);

which, in fact, displays a message on the monitor screen.
The reserved word end followed by a dot ends the entire program. The period notifies the compiler of the end of the program code. Behind the combination end. You can place any text - it will not be taken into account by the compiler.
Before we try to compile and execute our program, let's discuss its only executable statement, WriteLn(Text).

Interestingly, in Turbo Pascal, there are no special I/O operators. To exchange information with the outside world, programs written in Turbo Pascal use special standard procedures. Thus, at its core, the WriteLn(Text) operator is an operator accessing the built-in data output procedure ( it got its name from WRITE LiNe - write down a line).

The concept of procedure is one of the central concepts of Turbo Pascal. A procedure is a sequence of statements that can be referred to by name. Whenever we call a procedure name in a statement, the sequence of actions programmed in it is initiated.

The WriteLn procedure is one of the standard or built-in Turbo Pascal procedures. The built-in procedure does not require prior declaration; it is available to any program that contains a call to it. The difference between a write statement and a call to a write procedure is that the name of the write procedure, like any other Turbo Pascal procedure, is not a reserved word, and therefore the programmer can write his own procedure called WriteLn. However, for most users this feature remains only a linguistic subtlety and is very rarely used when writing programs.

The WriteLn procedure is one of the few Turbo Pascal procedures that allows the use of an arbitrary number of parameters when accessing it. Parameters are passed to the procedure in the form of a list, located in parentheses immediately after the procedure name. In our example, the procedure is passed a single constant parameter, Text. As we will see later, the very first parameter when calling the WriteLn procedure can be used to specify the address of the information receiver - the device or disk file to which the output is sent. In this way, the programmer can easily redirect the output. If, as in our example, no output address is specified, the output is directed to the display screen.

Looking at the program as a whole, we find that the four words used in it ( Program, const, begin and end) are reserved. The WriteLn word, as already noted, is not a reserved word, but it is unlikely that there will be a need to redefine it, since in this case the program will lose a powerful and convenient means of outputting data. The two words My_First_Program and Text serve as identifiers ( names) some program objects. The programmer can use any sequence of characters as identifiers that satisfy the following restrictions:

  • The identifier may consist of letters of the Latin alphabet, numbers, and an underscore; no other characters are allowed in the identifier;
  • The identifier cannot begin with a number;
  • The identifier cannot match any of the reserved words;
  • The length of the identifier can be arbitrary, but the first 63 characters are considered significant.

As elsewhere in the program, identifiers ignore the difference in letter height, so, for example, the identifiers Text, text and TEXT are identical from the compiler's point of view.

Now try to run the program. To do this, after typing its code, press Ctrl-F9. If you made no mistake when entering the text, then after a while you will see a quick change of images on the screen: immediately after loading Turbo programs Pascal clears the screen, making it available to the user's running program. This screen is called a program window. After the run is completed, the editor window with the program text will reappear on the screen. If you do not have time to see the image of the program window, press ALT-F5. After pressing any key, the environment will return the screen to the editor window playback mode.

A double frame outlining the program window indicates that this particular window is currently active. Let's make the editor window active: press the Alt key and, without releasing it, press the key with the number 1 (the editor window is number 1, the program window is number 2, see the upper right corners of the frames). Now everything is ready for further experiments with the program.

Let's try to change the text displayed on the screen. For example, remove the semicolon at the end of the third line and edit it this way:
Text = ‘this is my first program’
If you run the program again by pressing the CM-F9 keys, the compiler will report: Error 85: “;” expected. (Error 85: Missing ";".)
and the editor will place the cursor on the first character of the word begin, showing the place where an error was detected when parsing the text (the separator “;” can separate as many spaces as desired from the end of the statement; the compiler skips these spaces in search of the separator until it finds a reserved word , - that’s why the cursor is not at the end of the line with the declaration of the constant, but before the word begin). Correct the program - put a separator “;” at the end of the third line. and start the account again. This time everything will work fine, but the program output will change.

This text strictly matches the character set specified in the text constant, so it does not contain capital letters.

Data types

The structure of the considered program is as follows:
Program My_First_Program;
(Descriptions section)
begin
(Operators section)
end.
The words Program, begin and end highlight two parts of the program - the description section and the statement section. This structure is mandatory for any program, which is a consequence of a strict language requirement: any non-standard identifier used in executable statements must be previously described in the descriptions section. (Standard identifiers are associated with pre-declared objects and are part of the Turbo Pascal standard library. For example, the WriteLn identifier is. Standard identifiers, if used in a program, do not need to be described).

Requiring identifiers to be specified in advance seems overly restrictive and makes the language less free. In fact, it reveals a tendency in the development of programming languages ​​towards increasing the reliability of created programs. Who programmed in Fortran or BASIC ( these languages ​​do not require a preliminary description of identifiers), knows how difficult it can sometimes be to detect an erroneously entered or missing character in an identifier in a large program. If, for example, a variable named EPSILON is used throughout the program, but in one place it is incorrectly written EPSLON, then the program may compile safely and even give an almost plausible result for some data sets, but at some point it will begin to behave strangely. The mandatory preliminary description of identifiers in Turbo Pascal protects programs from this type of error and increases their reliability.

To describe an identifier means to indicate the type of program object associated with it (constant or variable). The concept of type is one of the core concepts of Turbo Pascal.

We will consider the following types:

  • INTEGER — integer data, in the internal representation it takes 2 bytes; range of possible values ​​- from -32768 to +32767; data is presented accurately;
  • REAL - real data, takes 6 bytes; the range of possible module values ​​is from 2.9E-39 to 1.7E+38; accuracy of data presentation - 11...12 significant figures;
  • CHAR - character, occupies 1 byte;
  • STRING - a string of characters, occupies MAX+1 byte, where MAX is the maximum number of characters in the line
  • BOOLEAN is a logical type, occupies 1 byte and has two values: FALSE (false) and TRUE (true).

The type of a constant is determined by the way its value is written:
Const
C1=17;
C2=3.14;
C3= ‘A’;
C4=’3.14’;
C5=false;
When analyzing this program code, the compiler will assign the first constant to type INTEGER, the second to type REAL, the third to CHAR, the fourth to STRING, and the last to BOOLEAN. A sign that allows a constant to be classified as REAL or INTEGER is the presence or absence of a decimal point in its value. Of course, constants C2 and C4 refer to different types: C2 is to REAL (the constant has a decimal point), and C4 is to STRING ( the constant is surrounded by apostrophes). The compiler will consider the SZ constant to be of type CHAR: a single character in apostrophes is classified as CHAR, while multiple characters are classified as STRING.

Unlike a constant, a variable names a program object that can change its value during calculation. When describing variables, the identifier is followed by a colon and the type name. Several similar variables can be combined into a list, separated by commas. The variable description section must begin with the reserved word VAR ( VAriables - variables).

As noted, the data type determines the length of the internal representation of the corresponding variables. Therefore, the length of the internal representation of variables of type STRING ( character string) depends on the maximum number of characters that can make up a string. As mentioned in the example, the variable text1 is described indicating its maximum length ( 15 characters), and in the description of the text2 variable the maximum length is not specified and the compiler will set it to the maximum length allowed in Turbo Pascal - 255 characters.

That's all, now you have the basis to start programming in the Turbo Pascal programming system. As you can see, this language is great for beginners and if you are interested, then study this language in more detail.

Ministry of Education Russian Federation

RUSSIAN STATE HYDROMETEOROLOGICAL UNIVERSITY

COURSE WORK

by discipline

COMPUTER SCIENCE

Subject:

Pascal programming environment and structure.

Full name, group:

Student address:

Date of completion:

Saint Petersburg

2010 .

1. Introduction. . . . . . . . . . . . . . . . . . 3

2. Programming environment. . . . . . . . . . . 5

3. Pascal's structural components. . . . . . . 8

3.1 Constants, variables, expressions. . . . 8

3.2 Branches and cycles. . . . . . . . . . . 9

3.3 Procedures, functions, modules. . . . . . eleven

3.3.1 Standard routines. . . . . 12

3.3.2 Procedures. . . . . . . . . . . 16

3.3.3 Functions. . . . . . . . . . . . 16

3.3.4 Modules. . . . . . . . . . . . . 17

3.3.5 Example of a structured program 18

3.4 Data types used. . . . . . . 18

4 Object-oriented programming. . . . 20

5 Visual programming tools. . . . . . 21

6 Conclusion. . . . . . . . . . . . . . . . . . 21

Bibliography. . . . . . . . . . . . . . . 22

1. Introduction

Skilled use of opportunities modern methods processing information using personal computer invariably associated with the use of programs. And the development and creation of programs for solving various practical problems is an integral part of the activities of any modern specialist working at the level of modern technologies. However, if the program executed by a computer processor is a sequence of commands of zeros and ones, then it is understandable only to professional programmers. This is machine code that is aimed at the computer processor, and not at all at humans. The problem of making a programmer's work easier is solved by using programming languages high level– languages ​​that are not computer-oriented, but human-oriented. The use of such languages ​​makes programming accessible not only to professional programmers, but also to any computer-literate person.

A high-level programming language is a formalized way of writing an algorithm, close enough to natural language and therefore accessible and understandable to humans, on the one hand, and at the same time, on the other hand, formally limited enough that it can be converted into machine code using a compiler program . Thus, a program written in a high-level language is quite independent of the type of computer.

In the era of mainframe computers, such languages ​​were ALGOL, FORTRAN, COBOL, in which many serious scientific and engineering programs were written. Currently, the number of high-level programming languages ​​in all their versions has long exceeded a thousand. Each of them was created to solve specific goals and therefore has its own differences and characteristics. So BASIC is simple and easy to compile. C and its advanced variant C++ are powerful tools for professional programming using object-oriented technologies. The Java language implements network programming capabilities. Ada is a specially developed tool for the US military department; its syntax is similar to the Pascal language.

The Pascal programming language was developed by Swiss mathematician Niklaus Wirdt in the late 60s and early 70s. Its purpose during development is to teach programming. The name of the language is given in honor of the French mathematician Blaise Pascal (1623-1662). Although easy to understand, the language is powerful enough to solve many problems. The language spread very quickly on a variety of platforms, but especially on IBM-compatible computers.

The first generations of the language were called Pascal, Turbo Pascal, after version 5.5 a more powerful version of Borland Pascal appeared. The numbering continued and along with Turbo Pascal 6, a version of Borland Pascal 6 and then Borland Pascal 7.0 appeared. The tools of this software product are an integrated program development environment that can solve almost all the problems a programmer faces during development. These are the tools:

Editing – convenient preparation and correction of program text;

Program compilation, accompanied by a search for programmer errors and qualified hints about their possible nature;

Tools for setting up the programming environment and environment (setting the current directory, setting options for the compiler, etc.);

Program debugging tools, for example, step-by-step program execution, the ability to view any variable;

Launching a program for execution directly from the programming environment.

The result of working in the programming environment are program texts - files with the extension .pas and executable files type *.exe, which can be used as an independent product outside the programming environment.

2. Programming environment

After running the BP.exe file, an integrated environment for working with created or open files programs.

Rice. 1 Integrated Environment Borland Pascal 7.0 in windowed mode.

Working in this environment is possible both in windowed mode (Fig. 1) and full screen (Fig. 2). The transition between these two modes is possible using the Alt+Enter chord.

Fig.2 Full screen mode

Full work on open or created programs possible in both the first and second cases. However, when using Cyrillic text display on the screen, problems are possible due to different DOS and Windows code tables. Older operating systems (Windows 98 and earlier) do not experience this problem. For WindowsXP it occurs. However, if it is not possible to configure the use of Cyrillic in full-screen mode, then when you switch to windowed mode (Windows encoding works), the “abracadabra” of the Cyrillic text is restored to full-fledged Russian text. However, in practice this problem is often avoided rather than dealt with by typing Russian text in Latin letters, for example: Zadaite chislo. A curiosity, of course, but widely used. In newer OS (for example Vista Starter) use full screen mode impossible, only windowed one works.

“Advanced” operating systems created in a DOS-integrated environment and compiled Pascal files of the *.exe type do not accept. Therefore, work with Pascal programs in this case is performed from the Pascal editor environment with files of the *.pas type.

Borland Pascal 7.0 also includes a Windows version of the integrated programming environment. It is launched from the BPW.exe file. The window of this environment in Fig. 3

Fig.3 Integrated programming environment in Pascal for Windows.

There are very minor differences between Pascal for Windows and Pascal for DOS. For example, the module for working with a monitor for DOS is called (and is called into the program in the Uses section) Crt, and for the Windows version it is WinCrt. Yeshe...

For getting course work In full, please contact the author using the details:

Mobile: 8 908 220 4152, ICQ: 482030413, skype: nikosimych

…. Is it necessary to study Pascal if there is a more powerful and more modern tool?

The answer to this question is clear: Pascal is still necessary for learning to program. The absence of highly professional subtleties that make it difficult to understand at the stage of starting to learn programming makes the Pascal programming language highly accessible and allowing a novice programmer to master all the necessary skills. Having gone through the first steps of programming in Pascal, it is not difficult to move on to Delphi (if you are not a professional programmer but an engineer), the C++ language (if you have a desire for professional programming), Java or PHP (if you are interested in working on the Internet) and any to another. It is much more efficient to learn the basics of programming in Pascal.

Bibliography:

1. Computer science. Basic course. S.V.Simonovich and others - St. Petersburg: PETER, 2000.

2. Computer Engineering and programming. Textbook for universities. Ed. A.V. Petrova - M.: Higher School, 1990.

3. IBM PC for users. Short course. V.E. Figurnov - M.: INFRA, 1997.

4. Programming in the Turbo Pascal 7.0 environment A. Epaneshnikov, V. Epaneshnikov - M.: “DIALOG-MEPhI”, 1995.

5. Computer science. Textbook for universities. Ostroykovsky V.A., - M.: Higher School, 1999.

6. Computer technology in engineering and economic calculations. A.V. Petrov and others - M.: Higher School, 1984.

7. Turbo Pascal 7.0. IN AND. Gryzlov, T.P. Gryzlova, - M., DMK, 1998.

8. Object-oriented programming. G.S. Ivanova, T.N. Nichushkina, E.K. Pugachev, - M., Moscow Higher Technical School named after. Bauman, 2001.

Under programming system understand the combination of a programming language and a virtual machine that ensures that a real machine executes programs written in this language.

Virtual machine This is a software package that connects the input language of a computer with another, machine language. The virtual machine contains translator and/or interpreter and may include routine libraries, a debugger, a linker, and other utility tools.

Translator is a program that translates texts from one language to another. In a programming system, a translator translates a program from the input language of this system into the machine language of the computer (on which this programming system operates or the program being developed will operate). One type of translator is compiler, providing translation of programs from a high-level language (close to a person) to a lower-level language (close to a computer), or a machine-dependent language. The program fed to the input of the translator is called original, and the result of the broadcast is object program.

An alternative means of language implementation—the interpreter—has diametrically opposed characteristics. Interpreter represents software, executing the presented program by simultaneously analyzing it and implementing the actions prescribed by it. When using an interpreter, there is no division into two stages (translation and execution) and, moreover, there is no explicit translation of the program, even in parts before the next stage of execution. In reality, the next program structure is recognized and the interpreter carries out the actions it defines. After this, the processes of analysis and implementation of prescribed actions are repeated cyclically.

Mixed strategies for implementing programming languages ​​are also possible, for example, translation into an intermediate language followed by interpretation of the intermediate program.

A program in a programming language consists of a sequence of operators (instructions) that specify certain actions. The main one is the assignment operator, which is used to change the contents of memory areas.

Program Execution comes down to consistent execution of statements to transform initial state memory (i.e. variable values) in final.

FreePascal IDE

Integrated Development Environment(ISR) (integrated development environment (IDE) simplifies the programming process and makes it more efficient. ISD contains the entire range of tools necessary for writing, editing, compiling, linking and debugging programs.

Free Pascal Compiler(FPC) is a free and open source Pascal compiler. It is compatible with Borland Pascal 7 and Object Pascal - Delphi, but has a number of additional features, for example, support for operator overloading. FPC is a cross-platform tool that supports a large number of platforms. Among them are AmigaOS, DOS, Linux, OS/2, MacOS(X) and Win32. Distributed with the compiler integrated development environmentFree Pascal text mode, similar to IDE Turbo/Borland Pascal (see Fig. 1).

Let us characterize the main elements of the Free Pascal ISR interface.

Menu bar is the primary means of accessing all menu commands. The menu bar is only invisible when the user is viewing information displayed by a running program.

If a menu command is followed by an ellipsis, the command opens a dialog box. If a command is followed by a right-facing triangle symbol, then selecting this command causes a lower-level menu to appear.

Rice. 1. Free Pascal development environment

If there are no additional symbols next to the command, this means that selecting this command leads to the immediate execution of the corresponding action.

Menu commands are accessed in one of the following ways:

    using a mouse;

    using the key followed by selecting the desired command using the cursor keys;

    direct selection of a menu item using a key combination +<Мнемокод>(the symbol highlighted in the name of the menu item, short letter designation); In order to subsequently execute the desired menu command, simply press the key corresponding to the shortcut symbol highlighted in the menu command.

Linemenu includes 10 main points.

    Menu item File contains commands for working with files, changing the working directory, and managing printing. Composition of menu commands File with an indication of the functions they perform is given in table. 1.

Table 1. Menu commands File

Menu command

Function performed

Quick keys

Opens a new empty editor window

Calls up the file open dialog box

New from template…

Opens a new editor window based on the selected template

Saves the current file

Saves the file with a new name

Saves files in all open windows

Prints a file

Opens the printer selection window

Opens the Change Working Directory dialog box

Invokes command line mode

Closes the IDE. If there are unsaved files, you will be prompted to save them.

    Menu item Edit contains editing commands. Composition of menu commands Edit with an indication of the functions they perform is given in table. 2.

Table 2. Menu commands Edit

Menu command

Function performed

Quick keys

Undoes previous action(s)

+

Restores undone action(s)

Copies the selected block to the clipboard at once

deleting it in the program text. Previous content

The clipboard is lost.

+

Copies the selected block to the clipboard. Previous

The contents of the clipboard are lost.

+

Pastes the contents of the clipboard at that text location

programs where the text cursor is located

+

Deletes the selected block

+

Selecting all program text

Deselecting

Opens a window that displays the contents of the clipboard

Copies the selected block to the Windows clipboard

Pastes the contents of the Windows clipboard into that location

program text where the text cursor is located

    Menu item Search contains search and replace commands. Composition of menu commands Search is given in table. 3.

Table 3. Menu commands Search

Menu command

Function performed

Quick keys

Provides search for the desired text fragment in the active editor window. When this option is accessed, the selection field of the dialog box contains the word that the cursor was pointing at in the active editor window. The user can enter a new word or text string whose position in the file being edited he needs to find.

Finds the desired text fragment in the editor window and replaces it with a new one.

Repeats a search or search and replace a piece of text for previously set parameters.

Go to line number

Positions the cursor in the editor window on the line with the specified number.

Allows you to find the desired procedure or function in the program text in debugging mode.

    Menu item Run contains commands for executing and step-by-step debugging of the program. Composition of menu commands Run is given in table. 4.

Table 4. Menu commands Run

Menu command

Function performed

Quick keys

Compiles, links and executes (runs) a program from an editor file. If the program has already been compiled at this point, the environment will immediately begin running it.

+

Starts or continues debugging mode of the executable program under the control of the built-in debugger. Calling this option will cause all actions programmed on the current line to be executed and the pointer will move to the next line of the program. If the current line contains a call to a procedure or function, control will be transferred inside that procedure (function) and the program will stop before executing its first statement. Thus, using this option, you can track the execution of all non-standard procedures (functions) step by step.

Performs step-by-step execution of the program, but, unlike the Trace into option, does not trace the work of called procedures and functions.

Starts or continues debugging mode of the executable program under the control of the built-in debugger. First, all the steps to compile and link the program are carried out, then the program begins to work in the usual way (the screen switches to the program window playback mode) and stops before executing the first statement from the line to which the cursor is pointing. At this moment, the screen returns to the editor window playback mode, and the line with the cursor is highlighted. You can move the cursor to a new line and select this option again - the program will stop before executing the new statement, etc. To stop debugging, you must press the keys +.

Resets all previously enabled debugging tools and stops debugging the program. Removes the running program from memory and closes all open files in it at that moment.

+

    Menu item Compile contains commands for compiling programs and modules. Composition of menu commands Compile is given in table. 5.

Table 5. Menu commands Compile

Menu command

Function performed

Quick keys

Compiles the program or module that is currently loaded in the active editor window. If this program (module) contains calls to non-standard user modules, the latter must already be compiled.

+

Compiles a file from the active editor window. If during the compilation process a declaration of a non-standard module is encountered, the environment checks whether any changes have been made in the file with the program text of this module since the last time it was compiled; if there were changes, the module will be recompiled.

This option significantly simplifies the process of developing multi-file programs, since only the minimum number of files affected by changes made in the program is always compiled.

Compiles the file from the active editor window, and also recompiles all connected modules, regardless of whether changes have been made to them or not.

Sets the operating system for which the program should be compiled

Specifies the name of the starting file from which compilation will begin in multi-file projects.

Clear primary file

Clears the primary file, after which the file of the active editor window will be compiled or executed.

Compiler messages

Shows the compiler message window.

    Menu item Debug contains program debugging tools. Composition of menu commands Debug is given in table. 6.

Table 6. Menu commands Debug

Menu command

Function performed

Quick keys

Opens the output results window, which displays the results of the program and messages operating system

+

Opens a window in which the results of the program are displayed. Differs from the Output command in that the resulting window has no frame or controls. To exit the window, press any key

Calls up the Watches window. This window is intended to contain observed parameters (variables), the values ​​of which change during program execution

Adds a new parameter (variable or expression) to the observed parameters window. Using this option, you can specify to the debugger those variables and/or expressions whose values ​​need to be monitored when debugging the program.

+

Sets a breakpoint on the current line of program code. A breakpoint is placed at a specific line of code, and the break occurs when given line should start executing

+

Breakpoint list

Shows the current list of control points in a separate window. This option allows you to view all control points and, if necessary, delete or move any control point or set the conditions for its operation

Opens and activates the window of used routines. This window contains the names of all subroutines that were called at a given time. Thus, you can observe the nesting of these subroutines and the sequence in which they are called by each other

+

Shows the current contents of the CPU loggers

    Menu item Tools includes some standard tools. As the user defines new tools, they will be added to this menu. To include a program in the list of those launched from the environment, use the command Tools menu Options. Composition of menu commands Tools is given in table. 7.

Table 7. Menu commands Tools

Menu command

Function performed

Quick keys

Shows a window that displays messages from external utilities included with the IDE. The Messages window opens automatically after launching the utility

Moves to the next line of the message window

+

Moves to the previous line of the message window

+

Searches for this or that information in the files of external utilities and places the result in the message window

+

Displays the built-in calculator window

Opens a window containing ASCII character codes

    Menu item Options includes commands that can be used to set the necessary parameters for the integrated development environment. Composition of menu commands Options is given in table. 8.

Table 8. Menu commands Options

Menu command

Function performed

Quick keys

Shows a dialog box to set the compiler mode

Sets parameters for controlling the generation of machine code of the program

Opens a dialog box that allows you to set the size of the used RAM

Opens a dialog box that allows you to set options that control how the linker works

Opens a dialog box that allows you to set parameters that determine how the debugger works

Specifies the directories from which files are extracted or placed. These directories will be used when compiling the program or module

Represents a dialog for setting browser options

Opens a dialog box with which you can add a new program (utility) to the list of programs called from the environment, edit its parameters, and remove the program from the list

Contains submenus that help set operating conditions in the environment

Opens a configuration file in which the set parameters integrated environment

Saves the environment configuration to a file opened with the Open command of the Options menu

Displays a dialog box that allows you to select a configuration file name other than the one specified by the Open command on the Options menu. This file records the settings of the integrated environment.

    Menu item Window includes window management commands. Composition of menu commands Window is given in table. 9.

Table 9. Menu commands Window

Menu command

Function performed

Quick keys

The windows are located in the screen field end-to-end without overlap

Cascading window placement

Clears the screen area, closing all windows

Allows you to resize the window and move it across the screen field. To resize the window, simultaneously press the key Press one of the keys: “up arrow”, “down arrow”, “left arrow” or “right arrow”. To move the window across the screen field, use the cursor keys. Finish work by pressing the key . The same operations can be performed using the mouse

+

Allows you to increase the size of the window to the entire screen area. If the window is already open, it shrinks to its original size

The next window by number is activated

The previous window number is activated

+

Hides the active window

+

Closes the active window

+

Opens a dialog box with a list open windows, which can be activated or closed

+<0>

Updates the environment screen if the user program has changed its contents

    Menu item Help allows you to obtain reference information available in the system. Composition of menu commands Help is given in table. 10.

Table 10. Menu commands Help

Menu command

Function performed

Quick keys

Shows help table of contents

A list of all keywords available in the information help system for which help is available is displayed in alphabetical order

+

Information about the word on which the cursor is located is displayed. If there is no information about such a word, a list of keywords is displayed, in which the word that matches the required maximum number of initial characters is highlighted.

+

Displays information on a topic that matches the previous query

+

Displays information about using the contextual help system

Displays a dialog box that allows you to specify context files

Displays a window with information about the package version and copyright

Edit window(see Fig. 1) is the area of ​​the screen in which the source text of the program is typed. Windows can be opened, moved, resized, placed without overlapping or cascaded, stacked on top of each other, and closed.

Title bar located at the top of the window and contains the name of the window and its number. In order to open the window to the entire screen frame, just double-click on the title bar. The window is moved by dragging the title bar.

Window close marker is a rectangle located in the upper left corner of the window. To close a window, click on it with the left mouse button.

Scroll bars are intended for moving through the program text.

Window resizing handle located in the lower right corner of the window. In order to increase or decrease the size of the window, you need to place the mouse pointer on the marker, press the left mouse button and, without releasing it, move the corner of the window in the desired direction.

Window swing marker located in the upper right corner. If the window is in partial-screen mode, the pop-up window marker icon is an up arrow that allows you to switch the window to full-screen view mode. If the window is in full-screen mode, the pop-up window marker icon is a bidirectional arrow that allows you to switch the window to partial-screen mode.

Status bar located at the bottom edge of the ISR window. The status bar contains a list of the main function keys, keyboard shortcuts, and their corresponding commands that can currently be applied to the active window. To quickly execute a command, just left-click on its name in the status bar. When you execute a menu command, the status bar displays tips and tricks for the selected menu command or dialog box items.

The status bar changes as you switch from one window to another or as you perform different actions.

Computer