5.1.7:Comments
コメント
Comments are remarks that are intended for a human to read
and are not executed. For some recommendations on what sort
of comments to include and when, see the section on
Good
Design Recommendations. Comments can be placed either
in a handler, or outside any handler.
コメントは人間が読むために書かれた注釈や覚え書きのようなもので、レヴォルーションではスクリプトとして実行されることはありません。どんなコメントをどんな時に書くべきかは、Good
Design
Recommendationsセクションをご覧下さい。コメントはハンドラ内にもハンドラ外にも書き込むことができます。
Any line (or portion of a line) that starts with two dashes
(--)
or a hash mark (#)
is a comment. Placing these characters at the beginning of
a line is called "commenting out" the line.
二つのダッシュ(ーー)又はハッシュ・マーク(#)で始まるどの行も、或いは行の途中の部分も、コメントとなります。この印を行の先頭に置くことを、行を「コメント・アウトする」と呼びます。
on
mouseUp -- this part is a comment
beep
--
and this is a comment too
end
mouseUp
You can temporarily remove a statement, or even an entire
handler, by commenting it out. To comment out several lines
at once, select them and choose Script ->
Comment.
コメント・アウトによって、一時的にステートメントやハンドラ全体を無効にできます。複数行を一挙にコメント・アウトするには、複数行を選択してをメニューからScript
-> Comment選びます
Since comments are not executed, you can place them
anywhere in a script--inside a handler or outside all
handlers.
コメントはスクリプトとして実行されることはありませんので、スクリプト内のどこにでもーーつまりハンドラ内にでもどのハンドラの外にでもーーコメントを置くことができます。
Comments that start with --
or
#
only extend to the
end of the line. To create a multiple-line comment, or
block comment, surround it with /*
and
*/
instead:
ーーや#で始まるコメントは、行末でコメントとしての機能は終わってしまいます。複数行に渡るコメント、つまりブロック・コメントを設定するには、コメントにしたい行全体を、次に示すように、/*と*/で囲ってしまいます。
on
openCard
/*
This is a multiple-line comment that might
contain
extensive information about this handler,
such
as the author's name, a description, or the
date
the handler was last changed. */
show
image "My Image"
pass
openCard
/* You can also make one-line comments */
end
openCard
【訳注】コメント部分の文字色は、訳者が変更して赤に設定しました。
Block
comments are handy
when you want to temporarily remove a section of code while
debugging a handler. You can place the characters "/*" at
the start of the section, and "*/" at the end, to prevent
the section from being executed.
ブロック・コメントは、ハンドラのデバグ時に一時的にコードのある部分全体を機能させたくないような時に便利に使えます。機能させたくないコードの先頭に「/*」を置き、最後に「*/」を置くだけで、スクリプトとしての実行された時にこの部分が無視されます。