BasicsTutorial/Input from the user

Last-modified: 2008-03-05 (水) 17:16:35

Input from the user

ユーザーからの入力

Now printing stuff is getting a bit boring, don’t you agree, lets let the user have a bit of input.
ものをプリントすることが少し退屈になっている今、あなたが同意しなくて、ユーザーにわずかな入力をさせることを放す。
And that’s exactly the command we use, INPUT.
そして、それは正確に我々が使用するコマンドであって、INPUT。

`Get info from user
Input “What is your name? ”,name$
Input “How old are you? ”,age
Input “What is the 14:15:12 ”,time#
`Print info from user
Print “Hello ”,name$
Print age,” is a great age”
Print “It’s really ”,time#,“?  I have to go!”
Wait key

Input works by having the prompt for the user in quotes before hand (or you could always use a string variable), and by having the variable that you want the users input stored in after the comma.
入力は、手の前の引用句のユーザーのために(または、あなたは文字変数を常に使うことができた)、そして、あなたがユーザー入力がコンマの後で中に格納されることを望む変数を持つことによって働く。
So for the first question, what ever I put in as my name will be stored in the name$ variable to be printed later.
それで、最初の問題のために、これまでに、私が私の名前として格納したことは、後でプリントされるname$変数に保管される。

You can also omit the prompt, for example if you wanted to do a prompt on the above line using PRINT.
あなたはプロンプトを省略することもできる。そして、あなたがPRINTを使っている上記の行で注意をしたいならば、例のためである。
Example…
実例…

Print "Input Name"
Input name$
Print "You are called ",name$
wait key

Well that’s basically it for the INPUT command.
よく、それは基本的にINPUT命令のためのそれである。

Summary of Commands

命令の概要

· INPUT [text,]variable - Prints a prompt from the code, and waits for the user to input something.
INPUT[テキスト,]変数 ― コードからのプロンプトと何かを入力するユーザーのための待ちをプリントする。
Then stores data in the specified variable
そして指定された変数に格納するデータ

End of Section Tasks

セクション終わりの作業

l Make a program that asks the user for their name, address, telephone number, age, gender and favourite food, and print it in an interesting way.
ユーザーにそれの名前、アドレス、電話番号、年齢、性と大好きな食物を求めるプログラムを行って、それを面白い方向でプリントしなさい。