Basic Pascal Tutorial/Hello, World/ja: Difference between revisions

From Free Pascal wiki
Jump to navigationJump to search
(Created page with "Hello, World (author: Tao Yue, state: unchanged) In the short history of computer programming, one enduring tradition is that the first program in a new language is a "Hello,...")
 
m (bypass language bar/categorization template redirect [cf. discussion])
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Hello, World (author: Tao Yue, state: unchanged)
{{Basic Pascal Tutorial/Hello, World}}


In the short history of computer programming, one enduring tradition is that the first program in a new language is a "Hello, world" to the screen. So let's do that. Copy and paste the program below into your IDE or text editor, then compile and run it.
Hello, World (著者: Tao Yue, 状態: 変更なし)


If you have no idea how to do this, return to the Table of Contents. Earlier lessons explain what a compiler is, give links to downloadable compilers, and walk you through the installation of an open-source Pascal compiler on Windows.
コンピュータープログラミングの短い歴史の中で、ひとつの長く続いている伝統に新たな言語における最初のプログラムは「Hello World」をスクリーンに表示させることというのがある。だから、それをやってみよう。以下のプログラムをコピーし、IDE あるいはテキストエディタにペーストしよう。それからコンパイルして走らせてみよう。
 
これをどうやるか見当がつかないのなら、内容目次に戻ろう。前のほうのレッスンでコンパイルとは何かを説明し、ダウンロードできるコンパイルへのリンクを示した。そしてウインドウ上にオープンソースの Pascal コンパイラをインストールするやり方を示している。


program Hello;
program Hello;
Line 10: Line 12:
end.
end.


The output on your screen should look like:
画面への出力は次のように見えるはずである。


Hello, world.
Hello, world.


If you're running the program in an IDE, you may see the program run in a flash, then return to the IDE before you can see what happened. See the bottom of the previous lesson for the reason why. One suggested solution, adding a readln to wait for you to press Enter before ending the program, would alter the "Hello, world" program to become:
もし、IDE 上でプログラムを走らせているなら、プログラムが一瞬走るのを目にしたら何が起こったのかを知る前に IDE に戻ってしまうかもしれない。どうしてこうなるかは前のレッスンの最後を見てください。ひとつの示唆された解決策は、プログラムが終了する前にエンターキーを押すのを待つように「Hello World」プログラムを次のように変更することである。


program Hello;
program Hello;
Line 21: Line 23:
   readln
   readln
end.
end.
 
{|style=color-backgroud="white" cellspacing="20"
previous contents next
|[[Basic Pascal Tutorial/Compilers/ja|previous]] 
|[[Basic Pascal Tutorial/Contents/ja|contents]]
|[[Basic Pascal Tutorial/Chapter 1/Program Structure/ja|next]]
|}

Latest revision as of 16:16, 20 August 2022

العربية (ar) български (bg) Deutsch (de) English (en) español (es) français (fr) italiano (it) 日本語 (ja) 한국어 (ko) русский (ru) svenska (sv) 中文(中国大陆) (zh_CN)

Hello, World (著者: Tao Yue, 状態: 変更なし)

コンピュータープログラミングの短い歴史の中で、ひとつの長く続いている伝統に新たな言語における最初のプログラムは「Hello World」をスクリーンに表示させることというのがある。だから、それをやってみよう。以下のプログラムをコピーし、IDE あるいはテキストエディタにペーストしよう。それからコンパイルして走らせてみよう。

これをどうやるか見当がつかないのなら、内容目次に戻ろう。前のほうのレッスンでコンパイルとは何かを説明し、ダウンロードできるコンパイルへのリンクを示した。そしてウインドウ上にオープンソースの Pascal コンパイラをインストールするやり方を示している。

program Hello; begin

 writeln ('Hello, world.')

end.

画面への出力は次のように見えるはずである。

Hello, world.

もし、IDE 上でプログラムを走らせているなら、プログラムが一瞬走るのを目にしたら何が起こったのかを知る前に IDE に戻ってしまうかもしれない。どうしてこうなるかは前のレッスンの最後を見てください。ひとつの示唆された解決策は、プログラムが終了する前にエンターキーを押すのを待つように「Hello World」プログラムを次のように変更することである。

program Hello; begin

 writeln ('Hello, world.');
 readln

end.

previous contents next