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,...")
 
No edit summary
Line 1: Line 1:
Hello, World (author: Tao Yue, state: unchanged)
Hello, World (著者: Tao Yue, 状態: 変更なし)


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」をスクリーンに表示させることというのがある。だから、それをやってみよう。以下のプログラムをコピーし、IDE あるいはテキストエディタにペーストしよう。それからコンパイルして走らせてみよう。


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


program Hello;
program Hello;
Line 10: Line 10:
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 21:
   readln
   readln
end.
end.
previous contents next

Revision as of 17:37, 2 July 2015

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.