[Ttssh2-commit] [4634] ・解説の文言を修正。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 9月 15日 (木) 00:17:11 JST


Revision: 4634
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4634
Author:   yutakapon
Date:     2011-09-15 00:17:10 +0900 (Thu, 15 Sep 2011)

Log Message:
-----------
・解説の文言を修正。
・サンプルマクロの追加

Modified Paths:
--------------
    trunk/doc/en/html/macro/command/intdim.html
    trunk/doc/en/html/macro/command/strdim.html
    trunk/doc/ja/html/macro/command/intdim.html
    trunk/doc/ja/html/macro/command/strdim.html


-------------- next part --------------
Modified: trunk/doc/en/html/macro/command/intdim.html
===================================================================
--- trunk/doc/en/html/macro/command/intdim.html	2011-09-14 01:01:12 UTC (rev 4633)
+++ trunk/doc/en/html/macro/command/intdim.html	2011-09-14 15:17:10 UTC (rev 4634)
@@ -24,15 +24,14 @@
 <h2>Remarks</h2>
 
 <p>
-<!--
-&lt;array size&gt;ŒÂ‚Ì—v‘f‚ðŽ‚Â®””z—ñŒ^‚̕ϐ”‚ðéŒ¾‚·‚éB&lt;array size&gt;‚̍őå’l‚Í65536B<br />
-”z—ñ“à‚ÌŠe—v‘f‚̏‰Šú’l‚Í0B
--->
+Defines the array of integer type having the &lt;array size&gt; entry. The &lt;array size&gt; range is from 1 to 65536 and the array index is 0-origin.<br />
+The default value of the array is 0.
 </p>
 
 <h2>Example</h2>
 
 <pre class="macro-example">
+; Fibonacci sequence
 intdim fibonacci 20
 fibonacci[0] = 0
 fibonacci[1] = 1
@@ -40,13 +39,96 @@
         fibonacci[i] = fibonacci[i-2] + fibonacci[i-1]
 next
 
-msg = ""
+msg = &quot;&quot;
 for i 0 19
-        sprintf2 msg "%s%d, " msg fibonacci[i]
+        sprintf2 msg &quot;%s%d, &quot; msg fibonacci[i]
 next
 
-messagebox msg "result"
+messagebox msg &quot;result&quot;
 </pre>
 
+
+<pre class="macro-example">
+; binary search tree
+N = 10
+intdim a N
+a[0] = 1
+a[1] = 2
+a[2] = 3
+a[3] = 7
+a[4] = 11
+a[5] = 32
+a[6] = 40
+a[7] = 68
+a[8] = 81
+a[9] = 99
+
+inputbox 'Search data?' 'User Input'
+str2int key inputstr
+
+flag = 0
+low = 0
+high = N - 1
+while low &lt;= high
+	mid = (low + high) / 2
+	if a[mid] == key then
+		sprintf &quot;Your data %d found in index %d.&quot; key mid
+		messagebox inputstr 'Success'
+		flag = 1
+		break
+	endif
+	if a[mid] &lt; key then
+		low = mid + 1
+	else
+		high = mid - 1
+	endif
+endwhile
+
+if flag == 0 then
+	messagebox 'Your data not found.' 'Failure'
+endif
+end
+</pre>
+
+
+<pre class="macro-example">
+; sieve of Eratosthenes
+;
+; Example of execution result
+; 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 [18 primes]
+;
+
+N = 30
+intdim flag N+1
+count = 1
+for i 0 N
+	flag[i] = 1
+next
+
+for i 0 N
+	if flag[i] =1 then
+		count = count + 1
+		p = 2 * i + 3
+		sprintf &quot;%d &quot; p
+		dispstr inputstr
+		
+		k = i + p
+		while k &lt;= N
+			flag[k] = 0
+			k = k + p
+		endwhile
+	endif
+next
+
+sprintf &quot;[%d primes]&quot; count
+dispstr inputstr
+
+end
+</pre>
+
+<h2>See also</h2>
+
+<a href="..\syntax\types.html">Types</a><br>
+
 </body>
 </html>

Modified: trunk/doc/en/html/macro/command/strdim.html
===================================================================
--- trunk/doc/en/html/macro/command/strdim.html	2011-09-14 01:01:12 UTC (rev 4633)
+++ trunk/doc/en/html/macro/command/strdim.html	2011-09-14 15:17:10 UTC (rev 4634)
@@ -24,10 +24,8 @@
 <h2>Remarks</h2>
 
 <p>
-<!--
-&lt;array size&gt;ŒÂ‚Ì—v‘f‚ðŽ‚Â•¶Žš—ñ”z—ñŒ^‚̕ϐ”‚ðéŒ¾‚·‚éB&lt;array size&gt;‚̍őå’l‚Í65536B<br />
-”z—ñ“à‚ÌŠe—v‘f‚̏‰Šú’l‚͋󕶎š—ñB
--->
+Defines the array of integer type having the &lt;array size&gt; entry. The &lt;array size&gt; range is from 1 to 65536 and the array index is 0-origin.<br />
+The default value of the array is an empty string.
 </p>
 
 <h2>Example</h2>
@@ -49,5 +47,9 @@
 messagebox msg "result"
 </pre>
 
+<h2>See also</h2>
+
+<a href="..\syntax\types.html">Types</a><br>
+
 </body>
 </html>

Modified: trunk/doc/ja/html/macro/command/intdim.html
===================================================================
--- trunk/doc/ja/html/macro/command/intdim.html	2011-09-14 01:01:12 UTC (rev 4633)
+++ trunk/doc/ja/html/macro/command/intdim.html	2011-09-14 15:17:10 UTC (rev 4634)
@@ -24,13 +24,14 @@
 <h2>‰ðà</h2>
 
 <p>
-&lt;array size&gt;ŒÂ‚Ì—v‘f‚ðŽ‚Â®””z—ñŒ^‚̕ϐ”‚ðéŒ¾‚·‚éB&lt;array size&gt;‚̍őå’l‚Í65536B<br />
+&lt;array size&gt;ŒÂ‚Ì—v‘f‚ðŽ‚Â®””z—ñŒ^‚̕ϐ”‚ðéŒ¾‚·‚éB&lt;array size&gt;‚Í 1 ` 65536 ‚͈̔͂̒l‚ðŽ‚Â‚±‚Æ‚ª‚Å‚«A”z—ñ‚Ì“YŽš‚Í0ƒIƒŠƒWƒ“‚Å‚ ‚éB<br />
 ”z—ñ“à‚ÌŠe—v‘f‚̏‰Šú’l‚Í0B
 </p>
 
 <h2>—á</h2>
 
 <pre class="macro-example">
+; ƒtƒBƒ{ƒiƒbƒ`”—ñ(Fibonacci sequence)
 intdim fibonacci 20
 fibonacci[0] = 0
 fibonacci[1] = 1
@@ -38,13 +39,97 @@
         fibonacci[i] = fibonacci[i-2] + fibonacci[i-1]
 next
 
-msg = ""
+msg = &quot;&quot;
 for i 0 19
-        sprintf2 msg "%s%d, " msg fibonacci[i]
+        sprintf2 msg &quot;%s%d, &quot; msg fibonacci[i]
 next
 
-messagebox msg "result"
+messagebox msg &quot;result&quot;
 </pre>
 
+
+<pre class="macro-example">
+; 2•ª’Tõ–Ø(binary search tree)
+N = 10
+intdim a N
+a[0] = 1
+a[1] = 2
+a[2] = 3
+a[3] = 7
+a[4] = 11
+a[5] = 32
+a[6] = 40
+a[7] = 68
+a[8] = 81
+a[9] = 99
+
+inputbox 'Search data?' 'User Input'
+str2int key inputstr
+
+flag = 0
+low = 0
+high = N - 1
+while low &lt;= high
+	mid = (low + high) / 2
+	if a[mid] == key then
+		sprintf &quot;Your data %d found in index %d.&quot; key mid
+		messagebox inputstr 'Success'
+		flag = 1
+		break
+	endif
+	if a[mid] &lt; key then
+		low = mid + 1
+	else
+		high = mid - 1
+	endif
+endwhile
+
+if flag == 0 then
+	messagebox 'Your data not found.' 'Failure'
+endif
+end
+</pre>
+
+
+<pre class="macro-example">
+; ƒGƒ‰ƒgƒXƒeƒlƒX‚Ì‚Ó‚é‚¢(sieve of Eratosthenes)
+;
+; Example of execution result
+; 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 [18 primes]
+;
+
+N = 30
+intdim flag N+1
+count = 1
+for i 0 N
+	flag[i] = 1
+next
+
+for i 0 N
+	if flag[i] =1 then
+		count = count + 1
+		p = 2 * i + 3
+		sprintf &quot;%d &quot; p
+		dispstr inputstr
+		
+		k = i + p
+		while k &lt;= N
+			flag[k] = 0
+			k = k + p
+		endwhile
+	endif
+next
+
+sprintf &quot;[%d primes]&quot; count
+dispstr inputstr
+
+end
+</pre>
+
+
+<h2>ŽQÆ</h2>
+
+<a href="..\syntax\types.html">ƒf[ƒ^Œ^</a><br>
+
 </body>
 </html>

Modified: trunk/doc/ja/html/macro/command/strdim.html
===================================================================
--- trunk/doc/ja/html/macro/command/strdim.html	2011-09-14 01:01:12 UTC (rev 4633)
+++ trunk/doc/ja/html/macro/command/strdim.html	2011-09-14 15:17:10 UTC (rev 4634)
@@ -24,7 +24,7 @@
 <h2>‰ðà</h2>
 
 <p>
-&lt;array size&gt;ŒÂ‚Ì—v‘f‚ðŽ‚Â•¶Žš—ñ”z—ñŒ^‚̕ϐ”‚ðéŒ¾‚·‚éB&lt;array size&gt;‚̍őå’l‚Í65536B<br />
+&lt;array size&gt;ŒÂ‚Ì—v‘f‚ðŽ‚Â®””z—ñŒ^‚̕ϐ”‚ðéŒ¾‚·‚éB&lt;array size&gt;‚Í 1 ` 65536 ‚͈̔͂̒l‚ðŽ‚Â‚±‚Æ‚ª‚Å‚«A”z—ñ‚Ì“YŽš‚Í0ƒIƒŠƒWƒ“‚Å‚ ‚éB<br />
 ”z—ñ“à‚ÌŠe—v‘f‚̏‰Šú’l‚͋󕶎š—ñB
 </p>
 
@@ -47,5 +47,9 @@
 messagebox msg "result"
 </pre>
 
+<h2>ŽQÆ</h2>
+
+<a href="..\syntax\types.html">ƒf[ƒ^Œ^</a><br>
+
 </body>
 </html>



Ttssh2-commit メーリングリストの案内
Back to archive index