Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
the Ministry of education and science of the Re...docx
Скачиваний:
0
Добавлен:
01.05.2025
Размер:
50.87 Кб
Скачать

Example

//Drawing with the mouse in the graphics window

//This program performs the drawing with the mouse in the graphics window:

uses GraphABC;

procedure MouseDown(x,y,mb: integer);

begin

MoveTo(x,y);

end;

procedure MouseMove(x,y,mb: integer);

begin

if mb=1 then LineTo(x,y);

end;

begin

// Bind event handlers to events

OnMouseDown := MouseDown;

OnMouseMove := MouseMove

end.

Example ;

//Moving a window using the keyboard

//This program performs the movement of the graphics window using the keyboard:

uses GraphABC;

procedure KeyDown(Key: integer);

begin

case of Key

VK_Left: Window.Left := Window.Left - 2;

VK_Right: Window.Left := Window.Left + 2;

VK_Up: Window.Top := Window.Top - 2;

VK_Down: Window.Top := Window.Top + 2;

end;

end;

begin

// Bind event handlers to events

OnKeyDown := KeyDown;

end.

I / o redirection

procedure SetConsoleIO;

Sets the console input-output

procedure SetGraphABCIO;

Sets the input / output via the graphical window (default)

Conclusion

System Pascal ABC is designed for teaching programming in the language Pascal and is aimed at students and graduates.

According to the authors of the initial training in programming should be fairly simple and friendly environments, at the same time, these media should be close to the standard on the capabilities of the programming language and have a fairly rich and modern standard library routines.

Language Pascal recognized by many teachers as one of the best exactly for initial training. However, the Borland Pascal-oriented MS DOS, outdated, and the environment Borland Delphi with its rich complicated for a novice programmer. So, attempt to start training with writing event-driven programs in Borland Delphi causes the shadow lot of difficulties and leads to a number of malformed skills.

For drawing in Pascal ABC need to run a special module GraphABC, the use of special functions and procedures will help you to draw a point, segment, circle, and rectangle and other shapes. Module bitmap graphics GraphABC without objects, although his possibilities are virtually coincide with graphics capability Borland Delphi. It is available in not one of the event programs and allows you to easily create animations without flicker.

The list of the used literature

  1. Mihalkovich SS Training system programming PascalABC // Scientific-methodical conference «Modern information technologies in education: the southern Federal district» 13-14 may 2004 / Kruker L.A., Muratova G.V... - Rostov-on-don: ЮГИНФО RSU, 2004.

  2. Mihalkovich SS Training system programming PascalABC: experience of development and use // the Second international scientific-practical conference «Modern information technologies and it-education: Collection of works. - Meters, in 2006..

  3. Divers N.N., Mihalkovich S.S., Tkachuk A.V. Experience in development of educational programming language for the platform .NET // Scientific-methodical conference «Modern information technologies in education: southern Federal district 26-29 April 2007 / Kruker L.А., Muratova G.V... - Rostov-na-Donu: Izd-vo «CVVR», 2007

  4. Abrahamian М.Э., Mihalkovich S. Fundamentals of programming in the language Pascal and Scalar data types, control operators, procedures, and functions. - Rostov-on-don: LLC «CVVR»

  5. Abrahamian М.Э. Workshop on programming in the language Pascal and Arrays, strings, files, recursion, pointers. - Rostov-on-don: LLC «CVVR», 2004.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]