Delphi for beginners (video tutorials). Introduction to Delphi Which version of Delphi to install

If you, %username%, having barely read the title of this article, feel butthurt a persistent rejection of the author, if the words "TForm1", "circular reference" and "Access violation" are not an empty phrase for you, if after another holivar in the corner of your consciousness it stirred again worm - this article is for you.

With enviable regularity, new articles of both supporters and opponents of Delphi appear, and the holivar invariably flares up with renewed vigor. And if 10-15 years ago the holivar was called “Delphi vs C ++”, now the front has moved close to the trenches of the supporters of the former Borland and the dispute is already within the framework of “Delphi vs non-Delphi”. Even the most stubborn followers of N. Wirth sometimes wonder why they suddenly became outcasts and eccentrics in the community of programmers?
If you, the reader, still think that you don’t need anything other than Delphi for work, compare at least the salary brackets for Delphi vacancies and the same Java. Have a desire to learn something other than Delphi? I will tell you where to start based on my own experience.

Where Do Delphi Programmers Come From?

While still a student, 7-8 years ago I got a job as a tester in a small company. Years passed, I mastered Delphi, on which all the desktop applications of this company were written, and became the lead programmer. I don't consider myself a guru, but Delphi and VCL are a well-read book for me. All holes had to learn to either bypass or close their own patches. To be fair, the VCL has very few outright failures. Much of what has been in Delphi for a long time has recently begun to appear in other platforms, but at the moment Delphi has practically no advantages over modern development tools. Alas, but it is a fact.

Some time ago, the big bosses invited me to a meeting and persuaded me to take on a new project. I had to put my beloved Delphi7 to the darkest and dustiest corner hard drive and, armed with the Internet, urgently master Qt. From the depths of memory, covered with cobwebs, little by little, modest institute knowledge of C surfaced. Multiplied by popular books on C ++ and documentation on Qt, they began to give the first results.

When developing desktop applications in any programming language, you will sooner or later come across C syntax and C++ elements. These are documentation and examples and painful "translation" of headers into your favorite language. With the advent of experience, a Delphi programmer can still understand C ++ programs tolerably, the abundance of "asterisks", "anpersands", the symbols "==" no longer seem like a meaningless mess and a conspiracy of the insidious Stroustrup to destroy your brain cells. In the end, you begin to see a certain beauty in some designs. Further we will assume that the reader is able to understand C-syntax tolerably well.

So, reader, I agree to learn something new, but what to choose?

Way one. Simplest. C#

Of the modern languages, C# is, oddly enough, the easiest to understand for Delphi-oriented brains. To switch from Delphi to C#, it is not at all necessary to start with a thick book from Microsoft. Most things will be intuitive, the rest is on MSDN. All objects, as expected, are pointers, methods and properties are always available through the "dot", no "->" for you. Automatic garbage collection, of course, will cause a reproachful shake of the head from a real Delphiist, but you quickly get used to the good. It is worth noting that you can program in C # not only in Visual studio, there is a wonderful SharpDevelop IDE. It's free, just like Delphi. The entry threshold is minimal - installed, launched, let's go! In both environments, you can rob cows by programming with the mouse, as we used to do in Delphi: the form editor is fundamentally no different, and double-clicking on the button will create a click handler method. In half an hour you will be able to make the first helloworld, in a day you will be able to roll out a working prototype of your own GPS navigator for an old but beloved PDA on Windows CE, and in a week or two you will start a new commercial project on it.
The main thing, do not forget, the comparison operator for equality is double equals "==". It is impossible to understand, you just have to remember.

The second path is thorny. C++

Comparing Delphi and С++ we can draw the following analogy: Delphi is a strong totalitarian state. Confess his ideology - and you will live happily ever after and even reach certain heights. Making a career is easy and pleasant, the path is destined. But it is worth taking a step to the side - execution!
C++ is a democracy. If you want, do it, if you want, do it. Or spit and do it your way. But please be responsible for your actions.

Here you will have to read special literature. Personally, I always prefer books for beginners. It is important to firmly understand exactly the basic things, then you will quickly reach aerobatics yourself. I'm currently finishing C++ for Beginners by Herbert Schildt. If you are a really experienced Delphi programmer, the first hundred pages can be flipped through not very carefully. Particular attention should be paid to working with pointers and the object model.

Now you need to choose an IDE. You can take the proven Visual Studio, but I chose Qt. It's free, cross-platform, has a rich set of classes, a great IDE, and great community support. Download Qt, install, that's it! We must pay tribute, Qt does not bother a novice programmer with unnecessary questions, it has built-in documentation and examples. Everything is like expensive commercial IDEs. It will no longer be possible to program with a mouse, although this may be for the better.
The first thing that doesn't fit into the Delphi-oriented brain is the lack of a primitive string type. It's hard to get used to it, but it's true. Secondly, to use the familiar approach to working with objects, we have to explicitly declare them as pointers. Thirdly, the module interface is usually stored in separate header files. This seems redundant at first glance, but, as you know, they don’t go to a strange monastery with their own charter. These are just first impressions. Having digested and comprehended them, we arm ourselves with books, manuals, Google and begin to turn our idea of ​​​​programming over. Qt is here to help.

Way three. Winding. web

If you want to open new horizons - welcome to web programming. Anarchy reigns here. Dozens of technologies, hundreds of implementations, thousands of mutually exclusive recommendations. There is no development environment in which the whole project could be done. However, it's worth a try, it's interesting. However, despite the abundance and simplicity of most web technologies, making a quality product is no easier than making a desktop application.

Conclusion

What you choose is up to you of course. Even if you stay true to Delphi, it's your choice, and not the worst, I must say. In any case, reader, remember: the quality of the product is determined by your abilities and skills, and only last but not least depends on the tools.

Hello. This article will focus on creating and using dynamic libraries in Delphi. ...if the task allows, load the library at the very start of the program, and free it at the very end, when exiting....

Bydlokod in the style of local residents. Demonstrates how to send a string from a library to the main application window...0); end; exports myproc; end. ...

It often happens that you need to have a screenshot of the window of your program, for example, in order to post it somewhere. Do prn... Simple and compact code. Of the minuses - the size of the picture is large - about 2-3 mb ....

Hello. Now we will write the simplest program in Delphi. We open it, we make the form smaller on f...edit). you will understand the rest yourself, because I myself understand delphi poorly ....

Now let's work with variables in delphi. open the text of the program there we are looking for the word imple ... a; end; end. You can google for other variables...

If necessary, then I have a whole textbook in Delphi (paper) I can throw off only examples from it, I'm starting ... ue; Img2.Visible:=False; end; end....

Now we will work with files in Delphi. add the memo component to the form ...leName:= SaveDialog1.FileName; it looks like a notepad...

Now I will tell you how to display messages in delphi. to display a simple message eat... begin edit1.Text:= "Cancel" end;...

Functions are written after the word private, and they are written like this: function Function name...construction inttostr; now if you press the button, the number 14 will appear in the label....

Hello lesson one. Console applications. Simple console applications, I won’t ... the ama of the site may be out of place, but the source codes from Delphi can be downloaded from my site on the people in the section of my files ...

Let's talk about string functions in Delphi. The delete.&nb...th. the field will be displayed 6, here we used the inttostr function to convert the number to a string ...

Hello me again. We throw a timer on the form from the System tab and the TrackB...sition component; Press F9 and try to move the slider, the shape will become transparent....

Greetings. Today we will write a web browser based on donkey. Create a new project and do the following: ...in Form2.Show; end; That's all! Everybody's Free....

Greetings! Now let's deal with the encryption of information. To begin with, I'll show you what we end up with: ...mme".

This article will cover working with text files in the Delphi environment.&nbs...loseFile(f); end; PS Sorry for the spelling....

In this lesson, you will learn how to create animations in Delphi (two ways) You will need a background (for the program...d The second way is inside! Download the file ...

Today I decided to "Scribble" an article on how to use a proxy for my program! :) these are themselves...te("2ip.ru"); dispose(proxytest); end;...

Computers are unreliable, but people are even more unreliable.

Where to begin?

Delphi, which is based on the Pascal language, is a great place to start learning how to program. Pascal itself is gradually becoming a thing of the past and less and less attention is being paid to it. This is understandable - applications for MS-DOS are written on it, and this single-tasking operating system everyone is trying to forget like a bad dream. To be more precise, the Delphi language is not Pascal in the form in which it is used to write MS-DOS applications, but in another modification - Object Pascal. In this language, programming is, as it were, "attached" to certain objects - both visual and non-visual, just in memory. Programming simple applications with interface command line(i.e. when lines of text are sequentially displayed on the screen and the user enters some data) it is also advised to start with Pascal. Also, many people start with QBasic, but this language is one of the most "ancient" and it has few possibilities. However, it is also suitable for understanding the general principles of programming. The fact is that in these languages ​​there are no ingenious constructions and character sets - the written code is easy to read and understand. This cannot be said, for example, about C++. There are jokes on this topic - "what a programmer wrote in C ++ at night, he will not be able to read in the morning." Of course, this is not true, but the syntax of the C++ language is quite complicated. We will start learning Delphi almost from scratch. Pascal will be studied along the way.

Why Delphi?

Delphi is something different than Pascal, it is a completely different qualitative stage of the programming environment. With the help of Delphi, applications for the Windows operating system are created, but in addition, with the help of additional tools, you can write, for example, programs for Linux. The Delphi environment is easily extended by installing additional modules. The user interface is also highly customizable - everyone organizes their workspace the way they want.

Brief information about Delphi

Delphi is the result of the development of the Turbo Pascal language, which, in turn, developed from the Pascal language. Delphi had a huge impact on the concept of the C# language for the .NET platform. Many of its elements and conceptual solutions have been incorporated into C#. One of the reasons is the transfer of Anders Hejlsberg, one of the leading Delphi developers, from Borland Ltd. at Microsoft Corp.
Version 1 was intended for development under the 16-bit Win16 platform;
Versions from the second compile programs under the 32-bit Win32 platform;
Together with the 6th version of Delphi, the Kylix environment, compatible with it in terms of language and libraries, was released, designed to compile programs for the Linux operating system;
Version 8 is capable of generating bytecode exclusively for the .NET platform. This is the first environment focused on the development of multilingual applications (only for the .NET platform);
Later versions (indicated by release years rather than sequential numbers, as was the case before) can create both Win32 applications and bytecode for the .NET platform;

Delphi for .NET - Delphi development environment, as well as the Delphi (Object Pascal) language, focused on developing applications for .NET.

What do we need...

It is assumed that you are familiar with the general rules of work in Windows system and worked in any applications at least a primitive level like Notepad or Calculator. From software we need the Delphi environment itself. The installation process will not be described, as it is fairly standard. You will not find Delphi distribution kits on the site - any of the versions has a volume of at least 200-300 MB, and storing such files on the site is simply unprofitable. Also, Delphi is not officially free. Therefore, if you do not have a distribution kit yet, try to find it as soon as possible. You can buy it in the store, or take it from someone you know. Of the free analogues of Delphi, Lazarus can be noted, but in these articles we will talk about Delphi.

What version of Delphi should I install?

This is one of the most frequently asked questions. By and large, they are all very similar and in most cases the programs will work the same regardless of the version of Delphi in which they were created. However, I will still give you some advice. Do not install lower versions Delphi 5- they are very old and have significant discrepancies with the newer ones. The Delphi 5 environment contains all the basic features, but it lacks some of the nice things that came in later versions. The best option - Delphi 6 or Delphi 7. These versions are most popular among the "population". Delphi 6 is considered the most stable. Delphi 7 is not much different from Delphi 6, except perhaps for greater compatibility with Windows XP (meaning the compatibility of written applications). This does NOT mean that programs written in Delphi 6 will not work correctly in WinXP. Everything will be great. But Delphi 7 is still less stable than Delphi 6. Further versions - Delphi 8, Delphi 9 I don't recommend installing at all. These are the most unfortunate of all. Attempts were made to integrate tools for writing applications on .NET technologies, but in response, the environments themselves turned out to be rather unsuccessful ("buggy"). Next worth mentioning Delphi 2005 Enterprise Edition. This version also did not receive a particularly wide distribution, and most programmers simply "stepped over" it. Next in line - Borland Developer Studio 2006. Yes, this is already a whole software package, which includes, in addition to Delphi, other development tools. The environment is convenient, but very resource-intensive. On older computers with random access memory less than 1 GB, I do not recommend using it. Borland stopped at this and further production began to be carried out on behalf of codegear(and then - Embarcadero). Delphi 2007 included in RAD Studio 2007, differs little in features from BDS 2006, but it is very well optimized and suitable for use on low-power machines, unlike its predecessor. Delphi 2009 is a new big step in the development of Delphi. In this version, full Unicode support appeared (everyone was waiting for this and it happened). Of course, along with new spaces for activity, this revealed new problems: some old programs, components and modules stopped working correctly. However, in most cases, all conflicts are resolved by editing a few lines. You shouldn't be afraid of this. If you are just starting your "journey", then there is no difference for you and therefore it is better to install more new version. All examples that will be given in these lessons work correctly in both old and new versions of Delphi. And finally, the latest version - Delphi 2010. I can't say much about her yet. Install it or not - decide for yourself. Perhaps it makes sense to get used to more proven versions for the time being.

Summing up, I advise you to choose from three options: Delphi 7, Delphi 2007 or Delphi 2009. Many people still work on the 7th version, arguing that there is nothing better than it in the world. But it is worth remembering that sooner or later everything old becomes obsolete to such an extent that it becomes unusable. Delphi 2007 is already closer to the present. Well, Delphi 2009 - if you don't want to lag behind the rest of the world. It's up to you, but I would choose the latter option.

Conclusion

In this article, we talked about the origins of Delphi and its features. Next, we will begin to study the environment itself and the programming language.

This article is based on questions on the forums: "How do I return a string from a DLL?", "How do I pass and return an array of records?", "How do I pass a form to a DLL?".

So that you do not spend half your life figuring it out - in this article I will bring everything on a silver platter.

The topics of this article, to varying degrees, have already been touched upon more than once in this blog, but in this article they are collected in a heap, justifications are given. In short, a link to this article can be thrown at those who develop the DLL.

Important note: article must be read successively. Code examples are provided only as examples, at each step (point) of the article, the code of examples is added with new details. For example, at the very beginning of the article there is no error handling, "classic" methods are indicated (such as using GetLastError , sdtcall conventions, etc.), which are replaced by more adequate ones in the course of the article. This is done for the reason that "new" ("unusual") designs do not raise questions. Otherwise, with each example, one would have to insert a note of the form: "this is discussed in that paragraph below, but that - in this one here." In any case, at the end of the article there is a link to a ready-made code written taking into account everything said in the article. You can just take it and use it. And the article explains why and why. If you are not interested in "why and why" - scroll to the end to the conclusion and a link to download the example.

Bakzhenova I.Yu. Delphi 7. Programmer's Tutorial. 2003 448 pp. PDF. 23.9 MB.
Content:
Object Pascal. Access to relational databases. Delphi component palette classes. BDE and InterBase. ODBC and OLEDB. Working with databases. Creating reports in Rave Reports. Development of SDI and MDI applications. COM and CORBA. Automation servers and containers. Publication of data on the Internet.
An excellent tutorial that allows you to feel free in the programming environment with simple examples.

Download.

Illustrated tutorial on Delphi 7 for beginners. The book you are holding in your hands is not a description of the Delphi language or the Delphi 7 Studio development environment. This is a tutorial on programming in the Delphi language in the environment of the same name. It covers the whole chain, the whole process of creating a program: from developing a dialog box and event handling functions to creating a help system and an installation disk.
The purpose of this book can be formulated as follows: to teach programming in the Delphi environment, that is, to create complete programs for various purposes: from simple single-window applications to quite professional database programs.
You can learn to program only by programming, solving specific problems. At the same time, success in programming is largely dependent on experience. Therefore, to get the most out of a book, you must work actively with it. Don't just read the examples, implement them with your computer. Do not be afraid to experiment - make changes to the programs. The more you do on your own, the more you will learn!
Skompel. chm help. 5.1 MB

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Download.

Kanjuba et al. Delphi 6/7. Databases and applications. 260 double pages djvu. 35.7 MB.
In the manual, pages 15-146 are devoted to the Object Pascal programming language itself and the development of the simplest programs in console execution in the Delphi environment. Part 2 contains the basics of developing windowed applications in the environment using the most convenient visual and non-visual components.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Download

Kornyakov. Programming MS Office documents and applications in Delphi. 2005 year. The book is devoted to creating applications in the Delphi environment for working with text, tables, objects, diagrams, macros, page settings, etc. in MS Word and Excel documents. Much attention is paid to the object models of MS Office documents. The programming of control elements of MS Word and Excel editors, as well as the creation of dynamic libraries that can be used in macros of MS Office documents, are considered. Options for software implementation of typical tasks and answers to typical questions that developers meet are given. 34.0 MB. 500 pages PDF.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Download.

Malinin, editor of the electronic version of the textbook. DELPHI - Lessons for beginners. html in RAR archive. 393 Kb.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Download.

Ozerov V. Delphi 7. Tips for Delphi. compiled help in the archive 176 Kb.
Delphi Tips - A collection of answers to non-traditional Delphi programming questions, non-standard solutions, tricks and interesting ideas. For the practical benefit of the case, specific code examples are given to convey the idea or fully answer the question.
When compiling the "Councils", the goal was not to include ALL materials, only the most interesting ones were selected. Numerous Western sources (FAQ), painstakingly selected and translated into Russian, served as the source of "Soviet". All of the above code is formatted so that you can copy it directly from the page into your application.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Download.

Flenov M. E. Delphi in jest and in earnest; what hackers can do. 2006 271 pp. djvu. 7.8 MB.
A book about professional programming techniques in Delphi. In an easy and accessible form, using a large number of original examples, the issues of correct coding, program optimization, working with the system environment, and creating network applications are considered. The book is intended primarily for beginner programmers with little programming experience, but it will be useful for professionals as well.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Download

4. Shupruta. Delphi 2005 learning to program. Tutorial. All basic questions about working in Borland Delphi 2005. Lots of examples. Recommendations for beginner programmers. Does not require initial training. 38.8 MB. 345 pp. PDF.

 
Articles on topic:
Three free dvd converters to convert discs to mp4 format
Why you may need to convert AVI to DVD? Imagine that you want to burn a DVD disc, and the source file is in AVI format. It is quite often used to reduce the size of a video. In this case, a handy DVD to AVI converter can help.
Where is the folder with directx files located on the computer Where is directx installed
With the development of technologies for creating animation for computer games and graphic editors, there is a need for improved rendering of objects and visual effects. DirectX software is used to solve this problem. This is a kind of
Master Class
Dear friends, I am glad to welcome you to the SITE. Today, I will introduce you to a big lesson - HOW TO MAKE A PICTURE WITH INVISIBLE BACKGROUND. And although the lesson is not big and simple, but, nevertheless, important. Very often there is a need to insert an image into a
Solving problems with screen sharing in Skype
Skype is a messenger with many useful features that novice users do not even know about. Gradually expanding their knowledge, they discover options for themselves and ask themselves how to accomplish this or that task. This article will explain how to do