BasicsTutorial/Remarking Code

Last-modified: 2008-02-21 (木) 15:16:58

Remarking Code

コメントのコード

That was some pretty long code, what if I went to save it and then came back a few months later to edit it, I probably wouldn’t have the foggiest what it does!
それはいくらかのかなり長いコードであった、私がセーブしに行った、それ、そして、その時それを編集するために数か月後に戻った、私は多分それがそうするものを最も霧が出ているようにしないだろう!
We need something to remind us what each section’s function is.
我々は、我々に各々のセクションの関数が何であるかについて思い出させる何かを必要とする。
Let’s bring back the code.
コードを戻そう。

Rem Label for the start of the program
Start:
Rem generate a random colour and draw a box
Randomize timer()
Ink rgb(rnd(255),rnd(255),rnd(255)),0
Box 10,10,100,100
Rem Position the text cursor below the box
Set cursor 0,150
Rem Print all the colour values extracted from the box
Print "Colour Value: ";
Print point(50,50)
Print
Print "Red Value: ";
Print rgbr(point(50,50))
Print
Print "Green Value: ";
Print rgbg(point(50,50))
Print
Print "Blue Value: ";
Print rgbb(point(50,50))
Rem Wait for a key press
Wait key
cls
Rem Loop back to the start of the program
Goto start

Putting REM at the start of a line makes the computer ignore it, this means we can add remarks wherever we want to help us remember what the code actually does.
REMを行の始まりに置くことはコンピュータをそれを無視させると、どこで我々が我々がコードが実際に何をするかについて覚えているのを手伝いたくても、我々が加えることができるこの手段が述べる。
This is especially helpful when your code reaches several thousand lines (and believe me that’s not that much for a reasonably sized game or program).
あなたのコードが数千の台詞(そして、私を信じなさい、かなり大きさを設定されたゲームのためのそんなに多くまたはプログラムでない)に達するとき、これは特に役に立つ。
You can always use a reversed apostrophe (top left corner of my keyboard) to remark lines (that’s handy if you’re impatient like me).
あなたは、行(あなたが私のように落ち着かないならば、それは便利である)を述べるために、逆にされたアポストロフィ(私のキーボードの左上隅)を常に使うことができる。

Rem This is a remark
`This is also a remark

If you want to remark big chunks of code REMSTART and REMEND are the commands for you.
あなたがコードの大きいかなりの量を述べたいならば、 REMSTARTと REMENDはあなたのための命令である。

Remstart
This is a massive chunk of text, it would be a bit
Of hassle to remark out all
Of it with REMs or `s, so I use these
Two commands, they are very handy when it
Comes to descriptions at the top of your code
Or remarking out big chunks of code
For testing.
I think I’ll stop remarking…
…………… NOW
Remend

You can also remark code that you need to get rid of, but you’re not sure if you’ll need them again.
あなたはあなたがなんとかする必要があるコードを述べることもできる、しかし、あなたが再びそれらを必要とするならば、あなたにはわからない。
After all, it’d be a big pain to delete a big chunk of code, then discover that you actually shouldn’t have.
結局、コードの大きいかなりの量を削除することは大きい痛みである、そして、あなたが実は持つべきでないということを発見しなさい。
Very handy remarking, I’d advise you use it all the time, I will in this tutorial from now on where we have long code.
論評して非常に便利で、私はあなたが常にそれを使うと忠告する、私は我々には長いコードがあるこの指導で今後そうする。

Summary of Commands

命令の概要

· REM - Makes a line of code so the computer ignores it.
REM-コンピュータがそれを無視するように、一連のコードを製作する。
Can also use `
「’」を使うこともできる。‘でもよい //でもよい

· REMSTART and REMEND - Used at either end of a big chunk of code to remark it all out
REMSTARTとREMEND-それら全部をコメントにする、コードの大きいかなりの量の最初と終わりで使われる

End of Section Tasks

セクション終わりの作業

l Remark some code… if you really want to :\ .
あなたが本当に必要とするならば、若干のcode…を述べなさい:\。