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=iso-8859-1"> |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
6 |
<title>logopen</title> |
<title>logopen</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 |
|
|
11 |
<body> |
<body> |
12 |
|
|
13 |
|
|
14 |
<h1>logopen</h1> |
<h1>logopen</h1> |
15 |
|
|
16 |
<p> |
<p> |
17 |
Causes Tera Term to start logging. |
Causes Tera Term to start logging. |
18 |
</p> |
</p> |
19 |
|
|
20 |
<pre class="macro-syntax"> |
<pre class="macro-syntax"> |
21 |
logopen <filename> <binary flag> <append flag> [<plain text flag> [<timestamp flag> [<hide dialog flag>]]] |
logopen <filename> <binary flag> <append flag> [<plain text flag> [<timestamp flag> [<hide dialog flag>]]] |
22 |
</pre> |
</pre> |
23 |
|
|
24 |
<h2>Remarks</h2> |
<h2>Remarks</h2> |
25 |
|
|
26 |
<p> |
<p> |
27 |
Received characters are written to the file <filename>.<br> |
Received characters are written to the file <filename>.<br> |
28 |
When the file does not include \ character, the file is saved at the TeraTerm current directory. If a user want to change the directory, use the <a href="changedir.html">changedir</a> macro command. |
When the file does not include \ character, the file is saved at the TeraTerm current directory. If a user want to change the directory, use the <a href="changedir.html">changedir</a> macro command. |
29 |
</p> |
</p> |
30 |
|
|
31 |
<p> |
<p> |
32 |
If <binary flag> is zero, received new-line characters are converted (CR -> CR/CRLF) and escape sequences are stripped out.<br> |
If <binary flag> is zero, received new-line characters are converted (CR -> CR/CRLF) and escape sequences are stripped out.<br> |
33 |
If <binary flag> is non-zero, received characters are written without any modifications. |
If <binary flag> is non-zero, received characters are written without any modifications. |
34 |
</p> |
</p> |
35 |
|
|
36 |
<p> |
<p> |
37 |
If <append flag> is non-zero and the file <filename> already exists, received characters are appended to it.<br> |
If <append flag> is non-zero and the file <filename> already exists, received characters are appended to it.<br> |
38 |
If <append flag> is zero and the file <filename> already exists, the file is overwritten. |
If <append flag> is zero and the file <filename> already exists, the file is overwritten. |
39 |
</p> |
</p> |
40 |
|
|
41 |
<p> |
<p> |
42 |
If <plain text flag> is not 0, ASCII non-printable characters are not written into log.<br> |
If <plain text flag> is not 0, ASCII non-printable characters are not written into log.<br> |
43 |
If <timestamp flag> is not 0, a timestamp is added on top of log.<br> |
If <timestamp flag> is not 0, a timestamp is added on top of log.<br> |
44 |
If <hide dialog flag> is not 0, "Log" dialog box is not displayed. |
If <hide dialog flag> is not 0, "Log" dialog box is not displayed. |
45 |
</p> |
</p> |
46 |
|
|
47 |
<p> |
<p> |
48 |
If a log file is successfully opened, the system variable "result" is set to 0. Otherwise, the "result" is set to 1. <em>(version 4.62 or later)</em> |
If a log file is successfully opened, the system variable "result" is set to 0. Otherwise, the "result" is set to 1. <em>(version 4.62 or later)</em> |
49 |
</p> |
</p> |
50 |
|
|
51 |
<h2>Example</h2> |
<h2>Example</h2> |
52 |
|
|
53 |
<pre class="macro-example"> |
<pre class="macro-example"> |
54 |
connect '/C=1' |
connect '/C=1' |
55 |
|
|
56 |
; get a user name |
; get a user name |
57 |
getenv 'USERNAME' username |
getenv 'USERNAME' username |
58 |
; get the date and time |
; get the date and time |
59 |
gettime timestr "%Y%m%d-%H%M%S" |
gettime timestr "%Y%m%d-%H%M%S" |
60 |
|
|
61 |
; add the user name and the timestamp to the log file name |
; add the user name and the timestamp to the log file name |
62 |
sprintf2 filename 'console_%s_%s.log' username timestr |
sprintf2 filename 'console_%s_%s.log' username timestr |
63 |
|
|
64 |
; change the current directory |
; change the current directory |
65 |
changedir 'C:\Documents and Settings\yutaka\desktop' |
changedir 'C:\Documents and Settings\yutaka\desktop' |
66 |
|
|
67 |
logopen filename 0 0 |
logopen filename 0 0 |
68 |
logwrite 'Log start'#13#10 |
logwrite 'Log start'#13#10 |
69 |
logwrite '*****************************************************'#13#10 |
logwrite '*****************************************************'#13#10 |
70 |
logclose |
logclose |
71 |
|
|
72 |
exit |
exit |
73 |
</pre> |
</pre> |
74 |
|
|
75 |
</body> |
</body> |
76 |
</html> |
</html> |