Posted on

What Is The Smallest Pascal Program

The Smallest Pascal Program

What Is The Smallest Pascal Program

Have you ever wondered what could be the smallest Pascal program? Let us create the smallest Pascal program in Delphi. Watch video for complete steps.

Go to File >> New >> Console Application. It will create this boilerplate code, but we don’t need all this code for the smallest Pascal program. Let us delete this from here to here. Delete this section also. Let’s press Control+D to format the source code. Now we have only three lines.

For the project’s name, we can save this project as A. Browse for the output folder and save this project as A. Let’s overwrite it.

So this is our smallest Pascal program. You see, it has only four words. Three out of these four words are “Reserved Words.” That is, PROGRAM, BEGIN and END. “A” is the possible shortest name of a program. We cannot use space or numeric characters.


You can use a lowercase “a” to make it even smaller. šŸ˜‰

Do You Know What Is Pascal Main Loop?

Just like we have aĀ  MAIN loop in C, Java, and other languages, we have a main Loop in Pascal. It starts from BEGIN and ends with this END and a full-stop, not a semicolon. So this “BEGIN” with this “END” act like a main loop in Pascal.

What Will The Smallest Pascal Program Do?

Of course, it will do nothing. It will just run and go away. If you execute it, you see it just displays for a fraction of a second, and then it closes immediately. We cannot even see the output window.

What Is The Size Of The Executable File?

Let us see its output file. Go to the project folder. Go to the Win32 folder. Go to debug folder. Here is our output file of 248 kilobytes. It is small software with 248 kilobytes, and this is the only code in it. Still, it’s a large file because we have some debugging information inside it.

How To Change The Delphi Output Settings From Debugging To Release?

If we go to build instead of debug, we change build-settings to release. Again run it and again check this file in the Win32 Release folder. We can see it is only 45 kilobytes now. So this software will be only 45 kilobytes, and we can even distribute it to others.

How To Stop The Smallest Pascal Program From Closing?

It is the simplest and the smallest Pascal program, but it does nothing. It does not even allow us to see the output. So let’s add some functionality.

First, let’s add some ReadLine so that it does not close automatically and waits for us to press the ENTER key. If we run it, we can see it is waiting for the ENTER key. If we press the ENTER key, it will close.

How To Make A Hello World Pascal Program

Now let us add a Write Line statement. Let us have it display our famous “Hello World.” Add a semicolon at the end. Save it, and let us rerun it. Now we have a software complete, software “Hello World” Pascal program waiting for an ENTER key. It will close if we press ENTER.

Check The Size of The Program After Adding Hello WorldCheck The Size of The Delphi Program After Adding Hello World

Let us see the size of this smallest Pascal Hello World Program. Teaching release, and it’s about 50 kilobytes. So it’s almost the smallest Pascal program and smallest in this sense also that it initially has only one, two, three, or four more words. Click this link to see Lazarus components usage.

So if we remove this functionality, the essential software basic Pascal program is only four words. It was our example of the first hello world and the smallest possible program. I hope you enjoyed it.

Subscribe to DelphiTube

Please like the video and subscribe to my channel to allow me to continue this work.
Thank you

Posted on

Why Is Code Optimization Important?


Coding a software solution is only a minor part of a long journey. We know this journey as the software development life cycle. Code optimization, design improvement, and code cleaning software can give a project an edge over rivals. Sadly, optimizing code was at the end of the spectrum in the old software creation life cycle. Luckily, now companies give importance to code optimization. Hence we now have many tools and features that are built into the system to optimize code. Continue reading Why Is Code Optimization Important?

Posted on

Why Is Software Testing Important?

Why Is Software Testing Important

The software testing is a vital step in software development. The software testing adds to the quality, speed and satisfaction. It also stops many pitfalls down the road. We can use software testing process to improve the quality of software. Continue reading Why Is Software Testing Important?

Posted on

Support FAQs of UrduKit

Frequently Asked Questions

Error while unlocking the full version of UrduKitĀ®

Q. I am having error while unlocking the full version of UrduKitĀ®. What to do?

Symptoms: On some machines error is displayed as:

  • Unable to write to Settings.INI
  • while on others noĀ  error is displayed but the UrduKitĀ® keeps asking the unlock code

Continue reading Support FAQs of UrduKit

Posted on

Kainaat InPage To Unicode Converter

kainat inpage to unicode text converter box

Kainaat InPage To Unicode ConverterĀ is a lightning-fast Trouble Free InPage Urdu To Unicode Text Converter. If you have InPage Urdu installed on your computer, you must also have this helpful tool. It also cleans up and frees InPage Urdu text from several common errors. You can easily order this product now. It initially supported Windows 95, Windows NT, Windows 2000, Windows XP, Windows 98, and Windows ME.Ā  Continue reading Kainaat InPage To Unicode Converter