Browse Subversion Repository
Contents of /trunk/doc/jp/html/macro/command/setexitcode.html
Parent Directory
| Revision Log
Revision 3227 -
( show annotations)
( download)
( as text)
Tue Mar 24 15:10:33 2009 UTC
(15 years, 1 month ago)
by maya
File MIME type: text/html
File size: 1652 byte(s)
CVS から SVN へ移行: 改行コードを LF から CR+LF へ変換
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
2 |
"http://www.w3.org/TR/html4/strict.dtd"> |
3 |
<html> |
4 |
<head> |
5 |
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> |
6 |
<title>setexitcode</title> |
7 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
8 |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
9 |
</head> |
10 |
|
11 |
<body> |
12 |
|
13 |
|
14 |
<h1>setexitcode</h1> |
15 |
|
16 |
<p> |
17 |
MACRO の終了コードを設定する。 |
18 |
</p> |
19 |
|
20 |
<pre class="macro-syntax"> |
21 |
setexitcode <exit code> |
22 |
</pre> |
23 |
|
24 |
<h2>解説</h2> |
25 |
|
26 |
<h3>Windows 98/Me の場合</h3> |
27 |
|
28 |
<p> |
29 |
MACRO がバッチファイルからコマンドライン "start /w ttpmacro <ttl filename>" (オプション /w が必要)によって実行された場合、終了コードを DOS コマンド "if errorlevel n" で調べることができる。 |
30 |
</p> |
31 |
|
32 |
<h3>Windows NT/2000/XP の場合</h3> |
33 |
|
34 |
<p> |
35 |
MACRO がバッチファイルからコマンドライン "ttpmacro <ttl filename>" によって実行された場合、終了コードを DOS コマンド"if errorlevel n" で調べることができる。 |
36 |
</p> |
37 |
|
38 |
<h2>例</h2> |
39 |
|
40 |
<pre class="macro-example"> |
41 |
----- バッチファイル "test.bat" (Win 98/Me の場合) ------ |
42 |
rem "start /w" コマンドで MACRO を実行 |
43 |
start /w ttpmacro test.ttl |
44 |
rem もし終了コードが1以上ならメッセージを表示 |
45 |
if errorlevel 1 echo Error! |
46 |
----- "test.bat" の終わり --------- |
47 |
|
48 |
----- バッチファイル "test.bat" (Win NT/2000/XP の場合) ------ |
49 |
rem MACRO を実行、"start" コマンドは不必要 |
50 |
ttpmacro test.ttl |
51 |
rem もし終了コードが1以上ならメッセージを表示 |
52 |
if errorlevel 1 echo Error! |
53 |
----- "test.bat" の終わり --------- |
54 |
|
55 |
----- マクロファイル "test.ttl" ---- |
56 |
; 終了コードを 1 にする。 |
57 |
setexitcode 1 |
58 |
----- "test.ttl" の終わり ---------- |
59 |
</pre> |
60 |
|
61 |
</body> |
62 |
</html> |
|