Browse Subversion Repository
Diff of /trunk/doc/jp/html/macro/appendixes/negative.html
Parent Directory
| Revision Log
| Patch
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
2 |
"http://www.w3.org/TR/html4/strict.dtd"> |
"http://www.w3.org/TR/html4/strict.dtd"> |
3 |
<html> |
<html> |
4 |
<head> |
<head> |
5 |
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> |
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> |
6 |
<title>負の整数定数についての注意</title> |
<title>負の整数定数についての注意</title> |
7 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
<meta http-equiv="Content-Style-Type" content="text/css"> |
8 |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
9 |
</head> |
</head> |
10 |
<body> |
<body> |
11 |
|
|
12 |
<h1>負の整数定数についての注意</h1> |
<h1>負の整数定数についての注意</h1> |
13 |
<p> |
<p> |
14 |
コマンドのパラメータに負の整数定数を使用する場合、以下のような問題が発生する場合がある。例えば、 |
コマンドのパラメータに負の整数定数を使用する場合、以下のような問題が発生する場合がある。例えば、 |
15 |
</p> |
</p> |
16 |
|
|
17 |
<pre><code>for i -10 0</code></pre> |
<pre><code>for i -10 0</code></pre> |
18 |
|
|
19 |
<p> |
<p> |
20 |
このコマンドは文法エラーを発生する。なぜなら、2番めのパラメータは "i" ではなくて、"i-10" とみなされるからである。この問題を防ぐには以下のいずれかの方法をとる。 |
このコマンドは文法エラーを発生する。なぜなら、2番めのパラメータは "i" ではなくて、"i-10" とみなされるからである。この問題を防ぐには以下のいずれかの方法をとる。 |
21 |
</p> |
</p> |
22 |
|
|
23 |
<ol> |
<ol> |
24 |
<li>"-" の前に "0" をつける。 |
<li>"-" の前に "0" をつける。 |
25 |
<pre><code>for i 0-10 0</code></pre> |
<pre><code>for i 0-10 0</code></pre> |
26 |
</li> |
</li> |
27 |
|
|
28 |
<li>負の整数定数を変数に代入してから使用する。 |
<li>負の整数定数を変数に代入してから使用する。 |
29 |
<pre><code>A = -10 |
<pre><code>A = -10 |
30 |
for i A 0 |
for i A 0 |
31 |
</code></pre> |
</code></pre> |
32 |
</li> |
</li> |
33 |
</ol> |
</ol> |
34 |
|
|
35 |
</body> |
</body> |
36 |
</html> |
</html> |
|
Legend:
Removed from v.3226 |
|
changed lines |
|
Added in v.3227 |
|
|
|