Console Application)

Source: Internet
Author: User
Let's first introduce Hello, world

"Hello, world"Program means to output" Hello, world! "only on the computer screen !" ("World, hello !") The computer program of this line of string. In general, this is the most basic and simple program in every computer programming language, and is usually the first program written by beginners. It can also be used to determine whether the language's compiler, program development environment, and runtime environment has been installed properly.

Using the output string "Hello World" as the first demonstration program has become a tradition of programming language learning. This program is based on the Computer Programming Tutorial C programming language (The C Programming Language) Is widely used, but this book is not a "hello World" abuse, although this is a common misunderstanding.

The "Hello World" sample program was first introduced in 1972 in introduction to the Language B, an internal technical file written by Brian corlinhan, a member of Bell Labs. The example of programming in C: A tutorial, which was written by the author in 1974, was also extended. This demonstration program was also retained in the C programming language developed by this document.

At first, the standard print content of the "Hello, world" program must be "all lowercase, no exclamation point, and a space should be blank after the dot ". However, it is rare to stick to the tradition.

Create the simplest console applicationstep 1,

OpenDelphi7, Click the menu"File | new | Other...", Select"Console Application". For example:

Step 2,

By default,Project1.dprFile, such:

Step 3,

The code in the red box is all the code of the program. The specific explanation is as follows:

Program project1; {starts with a critical program} {$ apptype console} {indicates that the program is a console program} uses {reference list of units used} sysutils; begin {begin .. program code in end} {todo-ouser-cconsole main: insert code here} end. {end. end of the program}
Step 4,

Below weBegin.. EndAdd the code that displays the Hello, world function, as follows:

Begin {begin .. end is the program code} writeln ('hello, World'); readln; end. {end. End of the program}
Step 5

Run F9 as follows:

At this point, a simple console program has been completed.

Lab

Project 1. EXE of the Program Generation executable file is42kbIf the uses field in the Code is missing (because writelnand readlnare not used in the Unit, the size of project1.exe is16 KB. It seems that the included and excluded sysutils units are very different.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.