Revision: 8418 https://osdn.net/projects/ttssh2/scm/svn/commits/8418 Author: yutakapon Date: 2019-11-28 20:12:35 +0900 (Thu, 28 Nov 2019) Log Message: ----------- マクロの負数に関するサンプルコードを修正した。 Modified Paths: -------------- trunk/doc/en/html/macro/appendixes/negative.html trunk/doc/ja/html/macro/appendixes/negative.html -------------- next part -------------- Modified: trunk/doc/en/html/macro/appendixes/negative.html =================================================================== --- trunk/doc/en/html/macro/appendixes/negative.html 2019-11-28 04:08:41 UTC (rev 8417) +++ trunk/doc/en/html/macro/appendixes/negative.html 2019-11-28 11:12:35 UTC (rev 8418) @@ -15,20 +15,25 @@ Using a negative integer constant may cause a problem like the following: For example, </p> -<pre><code>for i -10 0</code></pre> +<pre><code>for i 5 -1</code></pre> <p> -causes the syntax error, because the second parameter is regarded as "i-10" instead of "i". To avoid this problem, take one of the following solutions: +causes the syntax error, because the second parameter is regarded as "5-1" instead of "5" and the third parameter is empty. To avoid this problem, take one of the following solutions: </p> <ol> <li>Put "0" before "-". -<pre><code>for i 0-10 0</code></pre> +<pre><code>for i 5 0-1</code></pre> </li> + <li>Add parenthese. +<pre><code>for i 5 (-1)</code></pre> + </li> + <li>Assign the negative constant to a variable. -<pre><code>A = -10 -for i A 0 +<pre><code> +A = -1 +for i 5 A </code></pre> </li> </ol> Modified: trunk/doc/ja/html/macro/appendixes/negative.html =================================================================== --- trunk/doc/ja/html/macro/appendixes/negative.html 2019-11-28 04:08:41 UTC (rev 8417) +++ trunk/doc/ja/html/macro/appendixes/negative.html 2019-11-28 11:12:35 UTC (rev 8418) @@ -14,20 +14,25 @@ \x83R\x83}\x83\x93\x83h\x82̃p\x83\x89\x83\x81\x81[\x83^\x82ɕ\x89\x82̐\xAE\x90\x94\x92萔\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9\x8Fꍇ\x81A\x88ȉ\xBA\x82̂悤\x82Ȗ\xE2\x91肪\x94\xAD\x90\xB6\x82\xB7\x82\xE9\x8Fꍇ\x82\xAA\x82\xA0\x82\xE9\x81B\x97Ⴆ\x82A </p> -<pre><code>for i -10 0</code></pre> +<pre><code>for i 5 -1</code></pre> <p> -\x82\xB1\x82̃R\x83}\x83\x93\x83h\x82͕\xB6\x96@\x83G\x83\x89\x81[\x82\xB6\x82\xB7\x82\xE9\x81B\x82Ȃ\xBA\x82Ȃ\xE7\x81A2\x94Ԃ߂̃p\x83\x89\x83\x81\x81[\x83^\x82\xCD "i" \x82ł͂Ȃ\xAD\x82āA"i-10" \x82Ƃ݂Ȃ\xB3\x82\xEA\x82邩\x82\xE7\x82ł\xA0\x82\xE9\x81B\x82\xB1\x82̖\xE2\x91\xE8\x82\xF0\x96h\x82\xAE\x82ɂ͈ȉ\xBA\x82̂\xA2\x82\xB8\x82ꂩ\x82̕\xFB\x96@\x82\xF0\x82Ƃ\xE9\x81B +\x82\xB1\x82̃R\x83}\x83\x93\x83h\x82͕\xB6\x96@\x83G\x83\x89\x81[\x82\xB6\x82\xB7\x82\xE9\x81B\x82Ȃ\xBA\x82Ȃ\xE7\x81A2\x94Ԃ߂̃p\x83\x89\x83\x81\x81[\x83^\x82\xCD "5" \x82ł͂Ȃ\xAD\x82āA"5-1" \x82Ƃ݂Ȃ\xB3\x82\xEA\x81A3\x94Ԃ߂̃p\x83\x89\x83\x81\x81[\x83^\x82\xAA\x82Ȃ\xAD\x82Ȃ邩\x82\xE7\x82ł\xA0\x82\xE9\x81B\x82\xB1\x82̖\xE2\x91\xE8\x82\xF0\x96h\x82\xAE\x82ɂ͈ȉ\xBA\x82̂\xA2\x82\xB8\x82ꂩ\x82̕\xFB\x96@\x82\xF0\x82Ƃ\xE9\x81B </p> <ol> <li>"-" \x82̑O\x82\xC9 "0" \x82\xF0\x82\xAF\x82\xE9\x81B -<pre><code>for i 0-10 0</code></pre> +<pre><code>for i 5 0-1</code></pre> </li> + <li>\x8Aۊ\x87\x8Cʂ\xF0\x82\xAF\x82\xE9\x81B +<pre><code>for i 5 (-1)</code></pre> + </li> + <li>\x95\x89\x82̐\xAE\x90\x94\x92萔\x82\xF0\x95ϐ\x94\x82ɑ\xE3\x93\xFC\x82\xB5\x82Ă\xA9\x82\xE7\x8Eg\x97p\x82\xB7\x82\xE9\x81B -<pre><code>A = -10 -for i A 0 +<pre><code> +A = -1 +for i 5 A </code></pre> </li> </ol>