[Ttssh2-commit] [3959] サンプルコード修正

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 7月 30日 (金) 01:35:37 JST


Revision: 3959
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3959
Author:   yutakapon
Date:     2010-07-30 01:35:37 +0900 (Fri, 30 Jul 2010)

Log Message:
-----------
サンプルコード修正

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


-------------- next part --------------
Modified: trunk/doc/en/html/macro/command/filetruncate.html
===================================================================
--- trunk/doc/en/html/macro/command/filetruncate.html	2010-07-28 15:44:25 UTC (rev 3958)
+++ trunk/doc/en/html/macro/command/filetruncate.html	2010-07-29 16:35:37 UTC (rev 3959)
@@ -51,16 +51,28 @@
 </pre>
 
 <pre class="macro-example">
-; Quotas the limitation size of a log file.
-maxsize = 1024
+; Opens a log file at the macro file directory.
+getdir dir
+sprintf2 filename '%s\test.log' dir
 logopen filename 0 0
+; Limitation of a file size
+maxsize = 512
+counter = 0
+
 :loop
-logwrite '...'
+counter = counter + 1
+sprintf2 line 'counter = %d' counter
+logwrite line
+logwrite #13#10
 filetruncate filename maxsize
-do something...
-if err goto exit
+if result = -1 then
+	messagebox 'file truncate error' 'filetruncate'
+	goto skip
+endif
+if counter > 32 goto skip
 goto loop
-:exit
+
+:skip
 logclose
 </pre>
 

Modified: trunk/doc/ja/html/macro/command/filetruncate.html
===================================================================
--- trunk/doc/ja/html/macro/command/filetruncate.html	2010-07-28 15:44:25 UTC (rev 3958)
+++ trunk/doc/ja/html/macro/command/filetruncate.html	2010-07-29 16:35:37 UTC (rev 3959)
@@ -50,16 +50,28 @@
 </pre>
 
 <pre class="macro-example">
-; ƒƒOƒtƒ@ƒCƒ‹‚̃TƒCƒY‚ɏãŒÀ‚ðÝ‚¯‚é
-maxsize = 1024
+; ƒ}ƒNƒ‚ª‚ ‚éêŠ‚ɃƒOƒtƒ@ƒCƒ‹‚ðì‚é
+getdir dir
+sprintf2 filename '%s\test.log' dir
 logopen filename 0 0
+; ƒtƒ@ƒCƒ‹‚̏ãŒÀƒTƒCƒY
+maxsize = 512
+counter = 0
+
 :loop
-logwrite '...'
+counter = counter + 1
+sprintf2 line 'counter = %d' counter
+logwrite line
+logwrite #13#10
 filetruncate filename maxsize
-do something...
-if err goto exit
+if result = -1 then
+	messagebox 'file truncate error' 'filetruncate'
+	goto skip
+endif
+if counter > 32 goto skip
 goto loop
-:exit
+
+:skip
 logclose
 </pre>
 



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