How to create a console application in Delphi

Hello friends,
After a long time I decided to write a post about "Creating a console application in Delphi". Actually some time we don't want a GUI for an application that time we use many compiler that can compile console application, Delphi is one of them. I am using Delphi 7 for this but you may use any version of Delphi.

Creating application in Delphi is quite easy for me, that's why I choose Delphi. Firstly we need to understand two console commands for Delphi. These commands are use with console application only.

WriteLn : It displays a message, followed by an end-of-line code that positions the text cursor at the beginning of the next line.

ReadLn : It is used for reading text from console application.

Now, We will take an example for it. So here we go.

First of all we will open Delphi 7. Now, Go to File, New and click on Other... after clicking a new window will be appeared on that window Select Console Application and click on OK.


On clicking Console Application, A new window will be appeared, that is our IDE. Now, We will write our code in it. So let me write the code first.


Here, I written a small code that will add to numbers. It is an simple Console Application.


Now, let me explain the code, at first I used two variables. First one is Digit1, It is an integer. Second is Digit2 It is also used as an integer. In main codes, I wrote "ReadLn(Digit1)". It read an integer value from user same the second line read 2nd Digit from user. On 3rd line I wrote "WriteLn(Digit1  Digit2)", Its add two numbers that stored in Digit1 and Digit2 integer and write it to console. At the end I wrote "ReadLn" without any variable. It is just for break its behave same like "pause>nul" in Batch Files. 

So it is an simple example of Delphi Console applications. Hope you may create many apps in Delphi and will develop your programming skills. If you have any problems & questions regarding programming in Delphi, just comment below. I will answer them. 

Regards,
GautamGreat
CrackingGSM Team

SHARE

Author

Hi, Its me GautamGreat. A Reverser, Programmer and a developer. Developed a lot of programs. Cracking is my hobby I' am student of Class 12th, Who has a mobile phones repairing office. A blogger from heart and a student from mind.

    Blogger Comment
    Facebook Comment

6 comments:

  1. Win7 mey delphi7 thikse kaj nani karahahey. Mujhe konsa windows use karna parega?

    ReplyDelete
    Replies
    1. Hi,
      I am using Windows 7 x86 and Delphi is working perfectly in my pc.

      Regards,
      GautamGreat
      CrackingGSM Team

      Delete
  2. Will you please release some download link for members?

    ReplyDelete
  3. Will you please release some download link for members?

    ReplyDelete