Object Pascal in 2024

Hello everyone! My name is Sergey!

This article will focus more on FPC/Lazarusbut much of it can probably also be attributed to Delphi. This will be something like a review of the possibilities. Lazarus mixed with basic lessons. I won't reveal much here (in my opinion) and I hope the reader won't expect that I will be able to fully reveal all the secrets of programming (no need, no need to beat me for these words) in one article. I hope that this article will help beginners, and also give some information to not so beginners.

Throughout the article I will refer to videos in order to simplify the creation of the article. It would probably be better to take screenshots and attach them, but this will take much more time than preparing videos (considering that some of the videos are already ready) and the text of the article will increase several times.

Perhaps I will split the article into several parts. I will look at what I can lay out in this article and how much space it will take up.

Then just skip the information you don't need. ))) And please forgive me if you have to scroll too far.

Table of contents

A little bit about yourself

So that you understand, I am not a professional in my field, but I also have quite a bit of programming experience. And in some moments I can be wrong.

My main programming languages ​​(hereinafter PL) are Assembler and Pascal. I created programs for my general education in Java, C/C++, Perl and markup languages. In my occupation, I have to read the text of different PLs and translate/modify their code into Pascal. I even studied such a PL as Erlang, a fairly specific language and did not go into it too much.

At the moment, I am the lead developer of the cross-platform library ZenGL (don't confuse it, it's Pascal's library), by tacit agreement with Andrey. Before that, he was working on it Andrey Kemkahe “abandoned” it, and I accidentally stumbled upon it. At the moment when this library fell into my hands, all the programs being created could only be compiled for Windows or Linux. Perhaps, using outdated methods, it was possible to compile for old ones: Android, iOS and Mac; but it was quite difficult.

The library currently supports the following platforms: Windows, Linux, MacOS And Android (it is probably also possible to assemble it for different consoles running Windows or Linux).

I started programming with Spectrum and I can't even remember which one. It's clear that in this case my first programming language was Spectrum Basic. Then I encountered Pascal on Spectrum, I didn't like it there and I barely remembered it. I went to study to become a radio engineer. I wanted to become a programmer, but as usual, the programmer positions were already taken. But over time, I didn't even transfer to another specialty, because we also had programming, and here I was able to delve even deeper into circuit design. Which helps a little (personally for me) to understand how everything happens at a low level, at a level even lower than machine code. ))) Most people don't need this.

At the technical school we had Turbo Pascal (though maybe other PLs), but for me it was too simple. I studied programming with a friend and studied both Pascal and Assembler, but only Assembler for Spectrum.

After studying – work, then went to the army, then again work in the specialty of Electrician. Became an individual entrepreneur in electricity. And in the recent past tied up with electricity (well, almost tied up). Somewhere around the same period made tanks. Everyone remembers Battle Tanks? So I decided to do something similar. I had little experience in creating games, but something worked out.

But after another rework of the base, I came across ZenGL. And got carried away by the library development. During the development period I received quite a bit of knowledge, but it is more needed at a low level and often only once. There is no need to reinvent the wheel often, so that later it can be simply used. Therefore, many of the foundations laid in ZenGL They are simply used and do not change for a very long time. Although edits still have to be made.

In general, at the moment I am mainly engaged in programming. And also a little circuit design.

Why did I decide to write this article?

Quite recently I received an order to redesign some parts of the site. The code was given to Perland it had to be translated into PascalI probably would have refused if it weren't for one thing. BUT. I have been putting off working with the network for a very long time. All the developments that I studied were for static programs and I have never touched the network. And I had to start at least sometime.

And I decided that it was time to stop putting it off and get started.

I learned a little in a couple of weeks HTMLnetwork requests GET, POST. Well, and all sorts of little things. And already in anticipation I think: “Maybe I should create a site in Pascal?!”

… I encounter a DB (database)… I think many will understand me, who remember how to start this. Almost any site should work with a DB, and it was precisely learning how to work with a DB that took me the most time. Yes, I began to understand more about how everything works. I began to understand some of my mistakes in this area, but still a lot is not clear enough. So that you understand, I try to delve into what is happening inside and sometimes too meticulously. It is important for me to understand how everything works.

And I decided to write a simple program for working with the DB, after I understood the most basic. Both for practice and for use. I have Game Stick Lite and I have long had a desire to “remake its basis”, or rather, to shovel through the entire list of games and shove my own into it, and so that in Game Stick Lite everything worked fine.

And here I once again encountered many things: small problems, as far as my knowledge became sufficient to understand how everything works. And the most important thing is that I understand that many do not know what I know. And I decided to share the information. )))

And in the next article, you see, I’ll share the finished program.

“Simple Lessons”

Many people can simply skip these videos, they only provide basic information on working with Lazarus. Much has been explained before me and most people usually have no problems with it.

I hope you won't have any problems with the installation. FPC/Lazarusand if they do, there are plenty of examples on the Internet of how to install them. If you have any questions, please contact us here, here or to me. I can also answer some questions, although you can get help faster on the forums.

I'm sorry but for Delphi I can't provide links because that would require fairly reliable sources. You'll have to find the information yourself or hope that some kind person will drop a link(s) under the article.

I won't describe or touch on anything here. A lot of the lessons are described in books on Delphi and you can also watch Lazarus lessons on YouTube (not mine). Let's run through what I've been asked about quite often and the points that I think people who will use it should know. Lazarus.

Create, open and save a project.

Working with form, components. Changing component properties and testing code.

Setting up the Lazarus IDE and setting up the project.

I think this step is quite important because often the settings IDE solve many problems when working with a project and many settings can be made for yourself. Project settings have always been a fairly important part if you are constantly engaged in programming.

Extended examples

Groups of SpeedButtons

Many people know how to use SpeedButton, but in this case we have the ability to work with a group of buttons, where when one button is pressed, any of the others pressed in the group will be released. More precisely, it turns out that only one button can be pressed in a group.

Sorry for the quality of the video, I recorded it quite a long time ago.

Lazarus also has the ability to set multiple cursors and work with them. Hold down Ctrl + Shift and use the left mouse button to select a location for the next cursor in the code editor. At the beginning of the video I show how it works.

And I encountered some undocumented capabilities of components. Some components have these capabilities, and some do not. Well, it is also worth remembering that in components Lazarus added quite a few features, and some of them were not documented and may never be documented unless someone decides to add this information.

Summary

Even though many people are now reluctant to write on Pascalthen considering IDE Lazarus you can see that this shell is still developing and has quite a lot of functionality. Allowing you to customize both the shell itself and its working environment.

FPC/Lazarus, Delphi and many other Pascals continue to develop, some more, some less. People continue to use Pascal for their own interests and developments. Pascal allows you to create projects for different platforms and at the same time is a compiled programming language, which not many programming languages ​​can boast of (in no way is this an understatement of the capabilities of other programming languages!).

The Pascal community is quite large. If you look only at English language forum Lazarusyou can see that dozens of people communicate there every day. But if you look more closely, you can see that there are a lot of such forums and they are in different languages. Yes, fewer people communicate and ask questions there, there is even our Russian language site.

I don't think the community Delphi less. And probably there is still work going on there, and it's not that rare that there is work for people who use Delphi.

I am not encouraging you to use it. Pascal. I just gave a small review of one of its shells. And you always have the right to choose the PL that suits you best! )))


I'll finish the project and show you what I got in the end. I really want to. Game Stick Lite shovel. )))

Good luck to everyone!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *